SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2609.00759 · September 2026

Compile, Don't Memorize: A Context Compilation Architecture (CCA) for In-Context Learning

Wentao Zhang, Irwin King, Junli Wang, Minda Hu, Yanyu Chen, Jinhu Qi, Weiqiang Jin

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 (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 1 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/2609.00759.json · badge: /api/ran/2609.00759.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
TonyQJH/cca-emnlp2026 canonical (classifier label)
classifier basis: census
4 ran · 1 no recorded run
FunctionStatusWhere it lives
configure Ran
ran; our contract draft was wrong, not the code
TonyQJH/cca-emnlp2026/code/cca_core.py
code served (permissive licence) · get_code("ba03e63e6f137cc9")
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 OpenAI. 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 os

# Set up environment variables for testing
os.environ['OPENAI_API_KEY'] = 'test-key-12345'
os.environ['ANTHROPIC_API_KEY'] = 'test-anthropic-key'
os.environ['AWS_ACCESS_KEY_ID'] = 'test-aws-key'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'test-aws-secret'

ARGS = {
    'provider': 'openai',
    'model_id': 'gpt-4',
    'api_key': 'sk-test-key-123',
    'base_url': None,
    'region': 'us-east-1',
    'max_output_tokens': 8192,
    'max_context_chars': 120000,
    'max_reasoner_context': 240000,
    'temperature': 0.0,
    'max_compiler_tokens': 16384
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
anthropic, boto3, botocore, openai — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type OpenAI — a OpenAI output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a OpenAI 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
extract_json Ran
ran; our contract draft was wrong, not the code
TonyQJH/cca-emnlp2026/code/cca_core.py
code served (permissive licence) · get_code("12de2cde1bb6e417")
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 dict. 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 json
import re

def extract_json(text):
    """从文本中提取 JSON 对象(处理 markdown fence 和前置文字)。"""
    if not text:
        return None
    try:
        return json.loads(text.strip())
    except Exception:
        pass
    stripped = re.sub('^```(?:json)?\\n?', '', text.strip(), flags=re.MULTILINE)
    stripped = re.sub('\\n?```$', '', stripped.strip(), flags=re.MULTILINE)
    try:
        return json.loads(stripped.strip())
    except Exception:
        pass
    for m in reversed(list(re.finditer('\\{', text))):
        start, depth = (m.start(), 0)
        for i, c in enumerate(text[start:]):
            if c == '{':
                depth += 1
            elif c == '}':
                depth -= 1
                if depth == 0:
                    try:
                        return json.loads(text[start:start + i + 1])
                    except Exception:
                        break
    return None

ARGS = {
    "text": '```json\n{"key": "value", "number": 42}\n```'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
load_done_ids Ran
ran; our contract draft was wrong, not the code
TonyQJH/cca-emnlp2026/code/run_cca.py
code served (permissive licence) · get_code("64233ea48edaaa48")
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 set. 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 json
import os
import tempfile

# Create a temporary directory and file for testing
temp_dir = tempfile.mkdtemp()
output_path = os.path.join(temp_dir, "done_ids.jsonl")

# Create a sample JSONL file with some entries containing 'idx' fields
with open(output_path, 'w', encoding='utf-8') as f:
    f.write(json.dumps({'idx': 1, 'data': 'sample1'}) + '\n')
    f.write(json.dumps({'idx': 2, 'data': 'sample2'}) + '\n')
    f.write(json.dumps({'idx': 3, 'data': 'sample3'}) + '\n')
    f.write('invalid json line\n')  # This will be skipped due to exception handling
    f.write(json.dumps({'no_idx': 4}) + '\n')  # This will be skipped due to missing 'idx' key

ARGS = {
    'output_path': output_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type set — a set output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a set 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
load_tasks Ran
ran; our contract draft was wrong, not the code
TonyQJH/cca-emnlp2026/code/run_cca.py
code served (permissive licence) · get_code("5bacf5e653c53635")
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 list, ndim 1, 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 tempfile
import json
import os

# Create a temporary file with JSONL content
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.jsonl', encoding='utf-8')
temp_path = temp_file.name

# Write sample task data in JSONL format
tasks_data = [
    {"id": 1, "task": "example_task_1", "data": [1, 2, 3]},
    {"id": 2, "task": "example_task_2", "data": [4, 5, 6]},
    {"id": 3, "task": "example_task_3", "data": [7, 8, 9]}
]

for task in tasks_data:
    temp_file.write(json.dumps(task) + '\n')

temp_file.close()

ARGS = {
    'path': temp_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
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
llm_call Not yet run
unverified (harvested, no recorded run)
TonyQJH/cca-emnlp2026/code/cca_core.py
code served (permissive licence) · get_code("4eb3b344bca524b3")
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, 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 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.

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

Large language models (LLMs) increasingly handle in-context learning (ICL) tasks where a long, novel context defines the rules, knowledge, and output schema for a series of questions. On benchmarks that grade against every detail of the context, even strong open-weights models pass only 12-16% of tasks: a single overlooked rule fails the whole response. We argue this brittleness is structural: the dominant "read-and-reason" paradigm asks the model to extract, plan, generate, and self-verify in one forward pass. We therefore ask whether explicit context compilation can fix it, how it compares to existing long-context strategies (gist retrieval, multi-agent self-play), and where the resulting harness benefit holds across task structure and model scale. We propose the Context Compilation Architecture (CCA), whose central novelty is a typed intermediate representation (IR) with fixed slots (rules.{must_do, must_not, conditional}, output_spec, available_tools, data_profile) into which any prose context is compiled once; executable verifiers and a violation-gated correction loop follow as downstream consequences. On CL-bench (1,899 tasks across 4 open base models), CCA outperforms vanilla prompting and two long-context baselines (ReadAgent-P, Ctx2Skill) on every base model, lifting Kimi K2.5 from 15.4% to 21.4% with gains concentrated on rule-dense sub-categories. Code and cached completions are available at https://github.com/TonyQJH/cca-emnlp2026.

For agents

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

get_harvested_code_for_paper("2609.00759")
get_code_for_paper("2609.00759")
have("2609.00759")

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

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

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

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

Connect an agent — have() is free.