SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.04875 · 2024

On Provable Length and Compositional Generalization

arXiv · PDF · Open in the Atlas

Code that ran

5 of 6 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; 3 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 2 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/2402.04875.json · badge: /api/ran/2402.04875.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
facebookresearch/length-and-compositional-generalization canonical (classifier label)
classifier basis: census
5 ran · 1 no recorded run
FunctionStatusWhere it lives
float_division Ran
ran, honoured the contract we drafted
facebookresearch/length-and-compositional-generalization/src/utils/hydra_custom_resolvers.py
pointer only (licence: NOASSERTION) · get_code("367de505399f49a3")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/length-and-compositional-generalization (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

floor_division Ran
ran, honoured the contract we drafted
facebookresearch/length-and-compositional-generalization/src/utils/hydra_custom_resolvers.py
pointer only (licence: NOASSERTION) · get_code("ca0c9668ad6f95d2")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/length-and-compositional-generalization (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_logger Ran
ran; our contract draft was wrong, not the code
facebookresearch/length-and-compositional-generalization/src/utils/general.py
pointer only (licence: NONE) · get_code("61139ec62260b411")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, facebookresearch/length-and-compositional-generalization when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_pylogger Ran
ran; our contract draft was wrong, not the code
facebookresearch/length-and-compositional-generalization/src/utils/general.py
pointer only (licence: NOASSERTION) · get_code("2515c24df76ce408")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/length-and-compositional-generalization (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

num_files_in_directory Ran
ran, honoured the contract we drafted
facebookresearch/length-and-compositional-generalization/src/utils/hydra_custom_resolvers.py
pointer only (licence: NOASSERTION) · get_code("539cdc39227789a2")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/length-and-compositional-generalization (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

select_distribution Not yet run
unverified (harvested, no recorded run)
facebookresearch/length-and-compositional-generalization/src/utils/datamodule.py
pointer only (licence: NOASSERTION) · get_code("1f8a21421ae215d9")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/length-and-compositional-generalization (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. 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, 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 5 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
get_logger 15 other papers
10 dated earlier, 5 later · 3 only as an assembly brick
2009.09761 (2020-09)
DiffWave: A Versatile Diffusion Model for Audio Synthesis
2111.00396 (2021-11)
Efficiently Modeling Long Sequences with Structured State Spaces
2204.01692 (2022-04)
Long Movie Clip Classification with State-Space Video Models
and 12 more not named here

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

Out-of-distribution generalization capabilities of sequence-to-sequence models can be studied from the lens of two crucial forms of generalization: length generalization -- the ability to generalize to longer sequences than ones seen during training, and compositional generalization: the ability to generalize to token combinations not seen during training. In this work, we provide first provable guarantees on length and compositional generalization for common sequence-to-sequence models -- deep sets, transformers, state space models, and recurrent neural nets -- trained to minimize the prediction error. We show that \emph{limited capacity} versions of these different architectures achieve both length and compositional generalization provided the training distribution is sufficiently diverse. In the first part, we study structured limited capacity variants of different architectures and arrive at the generalization guarantees with limited diversity requirements on the training distribution. In the second part, we study limited capacity variants with less structural assumptions and arrive at generalization guarantees but with more diversity requirements on the training distribution. Further, we also show that chain-of-thought supervision enables length generalization in higher capacity counterparts of the different architectures we study.

For agents

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

get_harvested_code_for_paper("2402.04875")
get_code_for_paper("2402.04875")
have("2402.04875")

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

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

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

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

Connect an agent — have() is free.