SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.06028 · AAAI · 2022

OctAttention: Octree-Based Large-Scale Contexts Model for Point Cloud Compression

Rui Song, Ge Li, Wei Gao, Shan Liu, Chunyang Fu

arXiv · PDF · Open in the Atlas

Code that ran

4 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2202.06028.json · badge: /api/ran/2202.06028.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
zb12138/OctAttention community
Papers with Code archive
4 ran · 1 no recorded run
FunctionStatusWhere it lives
PositionalEncoding Ran
ran on a synthesized input · constructed an object; no result was computed
zb12138/OctAttention/octAttention.py
code served (permissive licence) · get_code("e7a55736537ed4bd")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, PositionalEncoding: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import math
import torch
import torch.nn as nn

torch.manual_seed(0)

# PositionalEncoding takes d_model, dropout, and max_len as parameters
# d_model: embedding dimension (used in pe tensor construction)
# dropout: dropout probability (passed to nn.Dropout)
# max_len: maximum sequence length (size of pe tensor)

ARGS = {
    'd_model': 4,
    'dropout': 0.1,
    'max_len': 5000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type PositionalEncoding — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PositionalEncoding output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
SelfMultiheadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
zb12138/OctAttention/octAttention.py
code served (permissive licence) · get_code("69a80903e8c7958e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, SelfMultiheadAttention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import math

torch.manual_seed(0)

# Parameters for SelfMultiheadAttention
emsize = 8  # embedding size, divisible by nhead
nhead = 4
dropout = 0.1

# Create the model
model = nn.Module()

# Create input tensor: (seq_len, batch_size, emsize)
# Using small dimensions: seq_len=3, batch_size=2, emsize=8
em = torch.randn(3, 2, 8)

# Create attention mask: same shape as attention_score
# attention_score shape will be (batch_size, nhead, seq_len, seq_len) = (2, 4, 3, 3)
# mask should be broadcastable to this shape
mask = torch.zeros(2, 4, 3, 3)

ARGS = {
    'emsize': emsize,
    'nhead': nhead,
    'dropout': dropout,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SelfMultiheadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SelfMultiheadAttention output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TransformerLayer Ran
ran on a synthesized input
zb12138/OctAttention/octAttention.py
code served (permissive licence) · get_code("fe7c5d69d63b47f1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 3, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import math

# Reproduce the classes from the prompt
class SelfMultiheadAttention(nn.Module):

    def __init__(self, emsize, nhead, dropout=0.5):
        super(SelfMultiheadAttention, self).__init__()
        self.nhead = nhead
        self.head_size = emsize // nhead
        assert self.head_size * nhead == emsize, 'embed_dim must be divisible by num_heads'
        self.all_head_size = int(self.nhead * self.head_size)
        self.mlpKey = nn.Linear(emsize, self.all_head_size)
        self.mlpQuery = nn.Linear(emsize, self.all_head_size)
        self.mlpValue = nn.Linear(emsize, self.all_head_size)
        self.dropout = nn.Dropout(dropout)

    def slice(self, x, dim):
        new_x_shape = x.size()[:-1] + (self.nhead, self.head_size)
        x = x.view(*new_x_shape)
        if dim == 3:
            x = x.permute(0, 2, 1, 3)
        elif dim == 4:
            x = x.permute(0, 1, 3, 2, 4)
            assert 0
        return x

    def forward(self, em, mask):
        em = em.transpose(0, 1).contiguous()
        Key = self.slice(self.mlpKey(em), em.dim())
        Query = self.slice(self.mlpQuery(em), em.dim())
        Value = self.slice(self.mlpValue(em), em.dim())
        attention_score = torch.matmul(Query, Key.transpose(-1, -2)) / math.sqrt(self.head_size)
        attention_score = attention_score + mask
        attention_map = self.dropout(nn.Softmax(dim=-1)(attention_score))
        context = torch.matmul(attention_map, Value)
        if context.dim() == 4:
            context = context.permute(0, 2, 1, 3).contiguous()
        elif context.dim() == 5:
            context = context.permute(0, 1, 3, 2, 4).contiguous()
        context_shape = context.size()[:-2] + (self.all_head_size,)
        context = context.view(*context_shape)
        context = context.transpose(0, 1).contiguous()
        return context

class TransformerLayer(nn.Module):

    def __init__(self, ninp, nhead, nhid, dropout=0.1):
        super(TransformerLayer, self).__init__()
        self.MultiAttention = SelfMultiheadAttention(emsize=ninp, nhead=nhead)
        self.linear1 = nn.Linear(ninp, nhid)
        self.dropout = nn.Dropout(dropout)
        self.linear2 = nn.Linear(nhid, ninp)
        self.norm1 = nn.LayerNorm(ninp, eps=1e-05)
        self.norm2 = nn.LayerNorm(ninp, eps=1e-05)
        self.dropout1 = nn.Dropout(dropout)
        self.dropout2 = nn.Dropout(dropout)

    def forward(self, src, src_mask):
        src2 = self.MultiAttention(src, src_mask)
        src = self.dropout1(src2) + src
        src = self.norm1(src)
        src2 = self.linear2(self.dropout(torch.relu(self.linear1(src))))
        src = src + self.dropout2(src2)
        src = self.norm2(src)
        return src

# Setup code
INIT_ARGS = {
    'ninp': 8,
    'nhead': 4,
    'nhid': 12,
    'dropout': 0.1
}

seq_len = 5
batch_size = 2
ninp = INIT_ARGS['ninp']
nhead = INIT_ARGS['nhead']

src = torch.randn(seq_len, batch_size, ninp)
src_mask = torch.zeros(batch_size, nhead, seq_len, seq_len)

ARGS = {
    'src': src,
    'src_mask': src_mask
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
TransformerModule Ran
ran on a synthesized input · constructed an object; no result was computed
zb12138/OctAttention/octAttention.py
code served (permissive licence) · get_code("6c927ce2bc5af651")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, TransformerModule: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn
import copy

torch.manual_seed(0)

nlayers = 3

class DummyLayer(nn.Module):
    """A minimal layer that accepts output and src_mask"""
    def __init__(self, hidden_dim=4):
        super().__init__()
        self.linear = nn.Linear(hidden_dim, hidden_dim)
    
    def forward(self, output, src_mask):
        # Use the mask to show it's being passed correctly
        if src_mask is not None:
            output = output * src_mask
        return self.linear(output)

# Create a dummy layer instance
layer = DummyLayer(hidden_dim=4)

# Create test inputs
src = torch.randn(2, 3, 4)  # batch_size=2, seq_len=3, hidden_dim=4
src_mask = torch.ones(2, 1, 3, 3)  # attention mask shape

ARGS = {
    "layer": layer,
    "nlayers": nlayers,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type TransformerModule — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a TransformerModule output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
TransformerModel Not yet run
unverified (harvested, no recorded run)
zb12138/OctAttention/octAttention.py
code served (permissive licence) · get_code("d8d0db2f26893d5b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
PositionalEncoding
brick of this paper's assembly: helper
3 other papers
2 dated earlier, 1 later · 1 only as an assembly brick
1706.03762 (2017-06)
Attention Is All You Need
2103.06495 (2021-03)
Read Like Humans: Autonomous, Bidirectional and Iterative Language Modeling for Scene Text Recognition
2211.10869 (2022-11)
Uni[MASK]: Unified Inference in Sequential Decision Problems

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

In point cloud compression, sufficient contexts are significant for modeling the point cloud distribution. However, the contexts gathered by the previous voxel-based methods decrease when handling sparse point clouds. To address this problem, we propose a multiple-contexts deep learning framework called OctAttention employing the octree structure, a memory-efficient representation for point clouds. Our approach encodes octree symbol sequences in a lossless way by gathering the information of sibling and ancestor nodes. Expressly, we first represent point clouds with octree to reduce spatial redundancy, which is robust for point clouds with different resolutions. We then design a conditional entropy model with a large receptive field that models the sibling and ancestor contexts to exploit the strong dependency among the neighboring nodes and employ an attention mechanism to emphasize the correlated nodes in the context. Furthermore, we introduce a mask operation during training and testing to make a trade-off between encoding time and performance. Compared to the previous state-of-the-art works, our approach obtains a 10%-35% BD-Rate gain on the LiDAR benchmark (e.g. SemanticKITTI) and object point cloud dataset (e.g. MPEG 8i, MVUB), and saves 95% coding time compared to the voxel-based baseline. The code is available at https://github.com/zb12138/OctAttention.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2202.06028")
get_code_for_paper("2202.06028")
have("2202.06028")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2202.06028.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2202.06028.svg)](https://syntology.ai/paper/2202.06028)

Connect an agent — have() is free.