SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.22248 · 2026

SamatNext v0.2-B: An Exploratory Study of RMS-Normalized Hybrid Decoders for Curriculum Retention in Small Code Models

Samat Zharassov

arXiv · PDF

Code that ran

5 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 0 failures of our instrument; 5 no recorded run), measured 2026-11-23; 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/2606.22248.json · badge: /api/ran/2606.22248.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
samat2003/samatnext-v0.1 community
Papers with Code archive
5 ran · 5 no recorded run
FunctionStatusWhere it lives
DeltaNetInspiredLinearStateMixer Ran
ran on a synthesized input
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("0573f9e9cca8ed4c")
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
from dataclasses import dataclass

@dataclass
class SamatNextConfig:
    vocab_size: int = 151936
    num_layers: int = 16
    hidden_size: int = 768
    num_attention_heads: int = 12
    num_key_value_heads: int = 4
    intermediate_size: int = 2048
    max_position_embeddings: int = 8192
    attention_ratio: float = 0.5
    deltanet_ratio: float = 0.5
    use_differential_attention: bool = True
    use_verifier_head: bool = False
    rms_norm_eps: float = 1e-06
    mixer_pattern: str = 'alternating'
    use_rope: bool = True

config = SamatNextConfig(
    vocab_size=128,
    num_layers=2,
    hidden_size=8,
    num_attention_heads=2,
    num_key_value_heads=2,
    intermediate_size=16,
    max_position_embeddings=32,
    attention_ratio=0.5,
    deltanet_ratio=0.5,
    use_differential_attention=True,
    use_verifier_head=False,
    rms_norm_eps=1e-06,
    mixer_pattern='alternating',
    use_rope=True
)

INIT_ARGS = {
    'config': config
}

hidden_states = torch.randn(2, 5, 8)

ARGS = {
    'hidden_states': hidden_states
}
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)
DifferentialAttention Ran
ran on a synthesized input
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("aa78b67383b17667")
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
from dataclasses import dataclass

@dataclass
class SamatNextConfig:
    vocab_size: int = 151936
    num_layers: int = 16
    hidden_size: int = 768
    num_attention_heads: int = 12
    num_key_value_heads: int = 4
    intermediate_size: int = 2048
    max_position_embeddings: int = 8192
    attention_ratio: float = 0.5
    deltanet_ratio: float = 0.5
    use_differential_attention: bool = True
    use_verifier_head: bool = False
    rms_norm_eps: float = 1e-06
    mixer_pattern: str = 'alternating'
    use_rope: bool = True

def apply_rotary_emb_da(xq, xk, freqs_cis):
    xq_ = torch.view_as_complex(xq.float().reshape(*xq.shape[:-1], -1, 2))
    xk_ = torch.view_as_complex(xk.float().reshape(*xk.shape[:-1], -1, 2))
    freqs_cis = freqs_cis.unsqueeze(0).unsqueeze(2)
    xq_out = torch.view_as_real(xq_ * freqs_cis).flatten(3)
    xk_out = torch.view_as_real(xk_ * freqs_cis).flatten(3)
    return (xq_out.type_as(xq), xk_out.type_as(xk))

class DifferentialAttention(nn.Module):

    def __init__(self, config: SamatNextConfig):
        super().__init__()
        self.hidden_size = config.hidden_size
        self.num_heads = config.num_attention_heads
        self.head_dim = self.hidden_size // self.num_heads
        self.use_rope = getattr(config, 'use_rope', True)
        self.q_proj = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
        self.k_proj = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
        self.v_proj = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
        self.q_proj_diff = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
        self.k_proj_diff = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
        self.o_proj = nn.Linear(self.hidden_size, self.hidden_size, bias=False)
        self.alpha = nn.Parameter(torch.zeros(1))

    def forward(self, hidden_states: torch.Tensor, freqs_cis=None) -> torch.Tensor:
        batch_size, seq_len, _ = hidden_states.shape
        q = self.q_proj(hidden_states).view(batch_size, seq_len, self.num_heads, self.head_dim)
        k = self.k_proj(hidden_states).view(batch_size, seq_len, self.num_heads, self.head_dim)
        v = self.v_proj(hidden_states).view(batch_size, seq_len, self.num_heads, self.head_dim)
        q_diff = self.q_proj_diff(hidden_states).view(batch_size, seq_len, self.num_heads, self.head_dim)
        k_diff = self.k_proj_diff(hidden_states).view(batch_size, seq_len, self.num_heads, self.head_dim)
        if self.use_rope and freqs_cis is not None:
            q, k = apply_rotary_emb_da(q, k, freqs_cis[:seq_len])
            q_diff, k_diff = apply_rotary_emb_da(q_diff, k_diff, freqs_cis[:seq_len])
        q = q.transpose(1, 2)
        k = k.transpose(1, 2)
        v = v.transpose(1, 2)
        q_diff = q_diff.transpose(1, 2)
        k_diff = k_diff.transpose(1, 2)
        base_out = torch.nn.functional.scaled_dot_product_attention(q, k, v, is_causal=True)
        diff_out = torch.nn.functional.scaled_dot_product_attention(q_diff, k_diff, v, is_causal=True)
        final_out = base_out + self.alpha * diff_out
        final_out = final_out.transpose(1, 2).contiguous().view(batch_size, seq_len, self.hidden_size)
        return self.o_proj(final_out)

config = SamatNextConfig(
    hidden_size=8,
    num_attention_heads=2,
    num_key_value_heads=1,
    use_rope=False
)

INIT_ARGS = {
    'config': config
}

batch_size = 2
seq_len = 3
hidden_size = 8

hidden_states = torch.randn(batch_size, seq_len, hidden_size)

ARGS = {
    'hidden_states': hidden_states,
    'freqs_cis': None
}

if __name__ == '__main__':
    model = DifferentialAttention(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Expected shape: ({batch_size}, {seq_len}, {hidden_size})")
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)
MLP Ran
ran on a synthesized input
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("9b78b0b0b405f317")
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, shape (2, 3, 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
import torch.nn as nn
import torch.nn.functional as F
from dataclasses import dataclass

@dataclass
class SamatNextConfig:
    vocab_size: int = 151936
    num_layers: int = 16
    hidden_size: int = 768
    num_attention_heads: int = 12
    num_key_value_heads: int = 4
    intermediate_size: int = 2048
    max_position_embeddings: int = 8192
    attention_ratio: float = 0.5
    deltanet_ratio: float = 0.5
    use_differential_attention: bool = True
    use_verifier_head: bool = False
    rms_norm_eps: float = 1e-06
    mixer_pattern: str = 'alternating'
    use_rope: bool = True

class MLP(nn.Module):

    def __init__(self, config: SamatNextConfig):
        super().__init__()
        self.gate_proj = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
        self.up_proj = nn.Linear(config.hidden_size, config.intermediate_size, bias=False)
        self.down_proj = nn.Linear(config.intermediate_size, config.hidden_size, bias=False)

    def forward(self, x):
        return self.down_proj(F.silu(self.gate_proj(x)) * self.up_proj(x))


config = SamatNextConfig(
    hidden_size=4,
    intermediate_size=8
)

INIT_ARGS = {
    'config': config
}

ARGS = {
    'x': torch.randn(2, 3, 4)
}
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, shape (2, 3, 4) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RMSNorm Ran
ran on a synthesized input
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("561893a8e22a4976")
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, shape (2, 3, 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
import torch.nn as nn

class RMSNorm(nn.Module):

    def __init__(self, hidden_size: int, eps: float=1e-06):
        super().__init__()
        self.weight = nn.Parameter(torch.ones(hidden_size))
        self.eps = eps

    def forward(self, hidden_states: torch.Tensor):
        variance = hidden_states.pow(2).mean(-1, keepdim=True)
        hidden_states = hidden_states * torch.rsqrt(variance + self.eps)
        return self.weight * hidden_states


INIT_ARGS = {
    'hidden_size': 4,
    'eps': 1e-06
}

ARGS = {
    'hidden_states': torch.randn(2, 3, 4)
}

if __name__ == '__main__':
    model = RMSNorm(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
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, shape (2, 3, 4) — shape (2, 3, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
VerifierHead Ran
ran on a synthesized input
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("4e78964872a9ea63")
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 1, dtype family float, shape (2,) 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
import torch.nn as nn
from dataclasses import dataclass

@dataclass
class SamatNextConfig:
    vocab_size: int = 151936
    num_layers: int = 16
    hidden_size: int = 768
    num_attention_heads: int = 12
    num_key_value_heads: int = 4
    intermediate_size: int = 2048
    max_position_embeddings: int = 8192
    attention_ratio: float = 0.5
    deltanet_ratio: float = 0.5
    use_differential_attention: bool = True
    use_verifier_head: bool = False
    rms_norm_eps: float = 1e-06
    mixer_pattern: str = 'alternating'
    use_rope: bool = True

class VerifierHead(nn.Module):

    def __init__(self, config: SamatNextConfig):
        super().__init__()
        self.proj = nn.Linear(config.hidden_size, 1, bias=False)

    def forward(self, hidden_states: torch.Tensor) -> torch.Tensor:
        last_token_hidden = hidden_states[:, -1, :]
        return self.proj(last_token_hidden).squeeze(-1)


config = SamatNextConfig(hidden_size=4)

INIT_ARGS = {
    'config': config
}

ARGS = {
    'hidden_states': torch.randn(2, 3, 4)
}
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 1, dtype family float, shape (2,) — shape (2,) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
SamatNextBlock Not yet run
unverified (harvested, no recorded run)
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("e4da66e4eeb21245")
How it ran

no invocation recorded.

SamatNextConfig Not yet run
unverified (harvested, no recorded run)
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("dbb602a6e0bb7c9b")
How it ran

no invocation recorded.

SamatNextForCausalLM Not yet run
unverified (harvested, no recorded run)
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("57efeb7a227efcd6")
How it ran

no invocation recorded.

SamatNextModel Not yet run
unverified (harvested, no recorded run)
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("ba9209dc2a19f476")
How it ran

no invocation recorded.

apply_rotary_emb_da Not yet run
unverified (harvested, no recorded run)
samat2003/samatnext-v0.1/models/samat_next/model.py
code served (permissive licence) · get_code("9f98a378df56fafa")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 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 10 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-23.

Repositories linked to this paper

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

Abstract

Standard autoregressive Transformer decoders trained on sequential curriculum distributions often can exhibit substantial forgetting under sequential fine-tuning, overwriting prior capabilities when exposed to new data. In this paper, we evaluate SamatNext v0.2-B, an experimental 356-million-parameter hybrid sequence decoder that alternates between Differential-Attention-style layers and DeltaNet-inspired simplified linear-state mixer layers featuring RMS Normalization and Output Scale Calibration. We investigate its behavior under a controlled, staged Python code curriculum and compare it directly to a parametermatched Transformer baseline. Our findings suggest that the hybrid design with scale calibration achieves a 100.0% pass rate on the controlled Stage 5 holdout (Stage 5) while retaining 98.8% of its adjacent semantic (Stage 3) capabilities, alongside a 12.0% Stage 2E pass rate. In contrast, the parameter-matched Transformer baseline trained with a learning rate of 3 × 10 -6 achieves a Stage 5 pass rate of 49.4% but retains only 3.8% of its Stage 3 semantic performance, with a 0.0% Stage 2E pass rate. Even when rescued using a higher learning rate of 1 × 10 -5 , the Transformer baseline achieves a Stage 5 pass rate of 97.6% but retains only 6.0% of its Stage 3 performance. Both models experience severe performance degradation on the early-stage adversarial syntax dataset (Stage 2E), indicating that the sequence mixer inductive bias alone does not resolve the broader problem of long-horizon catastrophic forgetting. We publish code, model specifications, evaluation scripts, and result tables to facilitate independent verification.

For agents

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

get_harvested_code_for_paper("2606.22248")
get_code_for_paper("2606.22248")
have("2606.22248")

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

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

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

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

Connect an agent — have() is free.