SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2509.15891 · ICCV · 2025

Global Regulation and Excitation via Attention Tuning for Stereo Matching

Jiahao Li, Xinhong Chen, Jianping Wang, Yung-Hui Li, Zhengmin Jiang, Qian Zhou

arXiv · PDF · Open in the Atlas

Code that ran

4 of 6 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (2 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 2 have no contract verdict; 2 failures of our instrument; 2 no recorded run), measured 2026-11-24; 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/2509.15891.json · badge: /api/ran/2509.15891.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
JarvisLee0423/GREAT-Stereo community
Papers with Code archive
4 ran · 2 no recorded run
FunctionStatusWhere it lives
AttentionLayer Ran
ran on a synthesized input · constructed an object; no result was computed
JarvisLee0423/GREAT-Stereo/models/great_stereo/transformers.py
code served (permissive licence) · get_code("69ddc82d1e9673b9")
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, AttentionLayer: 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 torch.nn.functional as F
from typing import Any, Tuple, Union
from einops import rearrange

torch.manual_seed(0)

def to_3d(inputs: torch.Tensor, dim: int=1) -> torch.Tensor:
    if dim == 1:
        return rearrange(inputs, 'b c h w -> (b h) w c')
    else:
        return rearrange(inputs, 'b c h w -> b (h w) c')

def to_4d(inputs: torch.Tensor, b: Union[int, float], h: Union[int, float], w: Union[int, float]=None, dim: int=1) -> torch.Tensor:
    if dim == 1:
        return rearrange(inputs, '(b h) w c -> b c h w', b=b, h=h)
    else:
        return rearrange(inputs, 'b (h w) c -> b c h w', h=h, w=w)

class AttentionLayer(nn.Module):

    def __init__(self, in_channels: int, hidden_channels: int, out_channels: int, num_heads: int=8, dropout: float=0.0, pre_norm: bool=True, norm_layer: Any=nn.LayerNorm, sink_competition: bool=False, qkv_bias: bool=True, eps: float=1e-06):
        super(AttentionLayer, self).__init__()
        self.eps = eps
        self.pre_norm = pre_norm
        self.sink_competition = sink_competition
        assert hidden_channels % num_heads == 0, 'hidden_dim and num_heads are not divisible.'
        self.scale = (hidden_channels // num_heads) ** (-0.5)
        self.num_heads = num_heads
        self.norm = norm_layer(in_channels if pre_norm else out_channels, eps=eps)
        self.norm_context = norm_layer(in_channels, eps=eps) if pre_norm else None
        self.to_q = nn.Conv2d(in_channels, hidden_channels, kernel_size=1, bias=qkv_bias)
        self.to_kv = nn.Conv2d(in_channels, hidden_channels * 2, kernel_size=1, bias=qkv_bias)
        self.to_out = nn.Conv2d(hidden_channels, out_channels, kernel_size=1)
        self.dropout = nn.Dropout(dropout) if dropout > 0.0 else nn.Identity()

    def forward(self, feats1: torch.Tensor, feats2: torch.Tensor) -> Tuple[torch.Tensor]:
        b, c, h, w = feats1.shape
        if self.pre_norm:
            feats1 = to_4d(self.norm(to_3d(feats1)), b, h)
            feats2 = to_4d(self.norm_context(to_3d(feats2)), b, h)
        query = to_3d(self.to_q(feats1))
        key, value = to_3d(self.to_kv(feats2)).chunk(2, dim=-1)
        query, key, value = map(lambda t: rearrange(t, 'bh w (n c) -> (bh n) w c', n=self.num_heads), (query, key, value))
        similarity_matrix = torch.einsum('bid, bjd -> bij', query, key) * self.scale
        if self.sink_competition:
            raw_attn = F.softmax(similarity_matrix, dim=-1) + self.eps
            raw_attn = raw_attn / torch.sum(raw_attn, dim=(-1,), keepdim=True)
        else:
            raw_attn = F.softmax(similarity_matrix, dim=-1)
        attn = self.dropout(raw_attn)
        out = torch.einsum('bij, bjd -> bid', attn, value)
        out = rearrange(out, '(bh n) w c -> bh w (n c)', n=self.num_heads)
        out = to_3d(self.to_out(to_4d(out, b, h)))
        if not self.pre_norm:
            out = self.norm(out)
        out = to_4d(out, b, h)
        return (out, similarity_matrix)

ARGS = {
    'in_channels': 4,
    'hidden_channels': 8,
    'out_channels': 5,
    'num_heads': 2,
    'dropout': 0.1,
    'pre_norm': True,
    'norm_layer': nn.LayerNorm,
    'sink_competition': False,
    'qkv_bias': True,
    'eps': 1e-06
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AttentionLayer — 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 AttentionLayer 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
FeedForwardLayer Ran
ran on a synthesized input · constructed an object; no result was computed
JarvisLee0423/GREAT-Stereo/models/great_stereo/transformers.py
code served (permissive licence) · get_code("1ec547833c4f96ae")
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, FeedForwardLayer: 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

torch.manual_seed(0)

ARGS = {
    'in_channels': 4,
    'out_channels': 8,
    'expansion': 2,
    'receptive_aug': 'conv',
    'norm_layer': nn.LayerNorm,
    'act_func': nn.SiLU,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FeedForwardLayer — 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 FeedForwardLayer 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
to_3d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JarvisLee0423/GREAT-Stereo/models/great_stereo/transformers.py
code served (permissive licence) · get_code("b8e5823a1cd4815b")
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 Tensor, ndim 3, dtype family float, shape (6, 5, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
from einops import rearrange

torch.manual_seed(0)

# Create a small 4D tensor with shape (batch, channels, height, width)
# Using distinct sizes: batch=2, channels=4, height=3, width=5
inputs = torch.randn(2, 4, 3, 5)

ARGS = {
    "inputs": inputs,
    "dim": 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, 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, shape (6, 5, 4) — shape (6, 5, 4) as a later run recorded it
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: none by the harness; any seed is in the setup block
to_4d Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
JarvisLee0423/GREAT-Stereo/models/great_stereo/transformers.py
code served (permissive licence) · get_code("e86e697a628c0575")
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 Tensor, ndim 4, dtype family float, shape (2, 4, 3, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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
from einops import rearrange

torch.manual_seed(0)

# Test case 1: dim=1 (default)
# The function uses: rearrange(inputs, '(b h) w c -> b c h w', b=b, h=h)
# This expects inputs shape: (b*h, w, c)
inputs_dim1 = torch.randn(6, 3, 4)  # (b*h=6, w=3, c=4) where b=2, h=3

# Test case 2: dim != 1
# The function uses: rearrange(inputs, 'b (h w) c -> b c h w', h=h, w=w)
# This expects inputs shape: (b, h*w, c)
inputs_dim2 = torch.randn(2, 12, 4)  # (b=2, h*w=12, c=4) where h=3, w=4

ARGS = {
    "inputs": inputs_dim1,
    "b": 2,
    "h": 3,
    "w": None,
    "dim": 1
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 4, 3, 3) — shape (2, 4, 3, 3) as a later run recorded it
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: none by the harness; any seed is in the setup block
TransformerBlock Not yet run
unverified (harvested, no recorded run)
JarvisLee0423/GREAT-Stereo/models/great_stereo/transformers.py
code served (permissive licence) · get_code("91825e9c5c198d4d")
How it ran

no invocation recorded.

TransformerFeatureRefiner Not yet run
unverified (harvested, no recorded run)
JarvisLee0423/GREAT-Stereo/models/great_stereo/transformers.py
code served (permissive licence) · get_code("87012b222202ec93")
How it ran

no invocation recorded.

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 6 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.

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-24.

Repositories linked to this paper

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

Abstract

Stereo matching achieves significant progress with iterative algorithms like RAFT-Stereo and IGEV-Stereo. However, these methods struggle in ill-posed regions with occlusions, textureless, or repetitive patterns, due to a lack of global context and geometric information for effective iterative refinement. To enable the existing iterative approaches to incorporate global context, we propose the Global Regulation and Excitation via Attention Tuning (GREAT) framework which encompasses three attention modules. Specifically, Spatial Attention (SA) captures the global context within the spatial dimension, Matching Attention (MA) extracts global context along epipolar lines, and Volume Attention (VA) works in conjunction with SA and MA to construct a more robust cost-volume excited by global context and geometric details. To verify the universality and effectiveness of this framework, we integrate it into several representative iterative stereo-matching methods and validate it through extensive experiments, collectively denoted as GREAT-Stereo. This framework demonstrates superior performance in challenging ill-posed regions. Applied to IGEV-Stereo, among all published methods, our GREAT-IGEV ranks first on the Scene Flow test set, KITTI 2015, and ETH3D leaderboards, and achieves second on the Middlebury benchmark. Code is available at https://github.com/JarvisLee0423/GREAT-Stereo.

For agents

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

get_harvested_code_for_paper("2509.15891")
get_code_for_paper("2509.15891")
have("2509.15891")

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

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

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

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

Connect an agent — have() is free.