SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2412.06769 · 2024

Training Large Language Models to Reason in a Continuous Latent Space

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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; 2 failures of our instrument; 1 no recorded run), measured 2026-11-23; 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/2412.06769.json · badge: /api/ran/2412.06769.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/coconut canonical (classifier label)
classifier basis: census
2 ran · 1 no recorded run
FunctionStatusWhere it lives
get_cot_latent_dataset Ran
ran; our contract draft was wrong, not the code
facebookresearch/coconut/dataset.py
code served (permissive licence) · get_code("80c44f3ee8a8217c")
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 ProcessedDataset. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 random
from unittest.mock import MagicMock

torch.manual_seed(0)
random.seed(0)

# Create a minimal config object
class Config:
    def __init__(self):
        self.uniform_prob = 0.0
        self.max_latent_stage = 3
        self.pad_latent_to_max = False
        self.no_cot = False
        self.c_thought = 1

configs = Config()

# Create a minimal dataset that behaves like HuggingFace Dataset
class MinimalDataset:
    def __init__(self):
        self.features = ['question_tokenized', 'steps_tokenized', 'answer_tokenized', 'idx']
        self.data = [
            {
                'question_tokenized': [1, 2, 3],
                'steps_tokenized': [[4, 5], [6, 7], [8, 9]],
                'answer_tokenized': [10, 11],
                'idx': 0
            },
            {
                'question_tokenized': [12, 13],
                'steps_tokenized': [[14, 15], [16, 17]],
                'answer_tokenized': [18],
                'idx': 1
            }
        ]
    
    def map(self, func, remove_columns=None, num_proc=None):
        processed = [func(sample) for sample in self.data]
        return ProcessedDataset(processed)
    
    def __len__(self):
        return len(self.data)

class ProcessedDataset:
    def __init__(self, data):
        self.data = data
    
    def shuffle(self):
        shuffled_data = self.data.copy()
        random.shuffle(shuffled_data)
        return ProcessedDataset(shuffled_data)
    
    def __len__(self):
        return len(self.data)
    
    def __getitem__(self, idx):
        return self.data[idx]

base_dataset = MinimalDataset()

ARGS = {
    'scheduled_stage': 2,
    'base_dataset': base_dataset,
    'configs': configs,
    'start_id': 100,
    'latent_id': 101,
    'end_id': 102,
    'no_special_marker': False,
    'shuffle': False
}
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 ProcessedDataset — a ProcessedDataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ProcessedDataset output the recorded ndim 1 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
get_question_latent_dataset Ran
ran; our contract draft was wrong, not the code
facebookresearch/coconut/dataset.py
code served (permissive licence) · get_code("b4743e2f62134632")
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 Dataset. 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 numpy as np
from datasets import Dataset

torch.manual_seed(0)

# Create a minimal config object with required attributes
class MinimalConfig:
    def __init__(self):
        self.pad_latent_to_max = False
        self.max_latent_stage = 3
        self.c_thought = 2

configs = MinimalConfig()

# Create a minimal dataset with required structure
base_samples = [
    {
        'question_tokenized': [10, 11, 12],
        'steps_tokenized': [20, 21, 22, 23, 24],
        'idx': 0
    },
    {
        'question_tokenized': [13, 14],
        'steps_tokenized': [25, 26],
        'idx': 1
    }
]

base_dataset_valid = Dataset.from_dict({
    'question_tokenized': [[10, 11, 12], [13, 14]],
    'steps_tokenized': [[20, 21, 22, 23, 24], [25, 26]],
    'idx': [0, 1]
})

scheduled_stage = 2
start_id = 100
latent_id = 101
end_id = 102
no_special_marker = False

ARGS = {
    'scheduled_stage': scheduled_stage,
    'base_dataset_valid': base_dataset_valid,
    'configs': configs,
    'start_id': start_id,
    'latent_id': latent_id,
    'end_id': end_id,
    'no_special_marker': no_special_marker
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
datasets, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Dataset — a Dataset output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Dataset output the recorded ndim 1 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
get_dataset Not yet run
unverified (harvested, no recorded run)
facebookresearch/coconut/dataset.py
code served (permissive licence) · get_code("9a9792caf435580c")
How it ran

no invocation recorded.

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 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 3 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) are typically constrained to reason in the language space, where they express the reasoning process through a chain-of-thought (CoT) to solve complex problems. However, the language space may not always be optimal for reasoning. Most word tokens primarily ensure textual coherence and are not essential for reasoning, while some critical tokens require complex planning and pose challenges to LLMs. To explore the potential of reasoning beyond language, we introduce a new paradigm called Coconut (Chain of Continuous Thought). Coconut utilizes the last hidden state of the LLM as a representation of the reasoning state, termed "continuous thought." Instead of decoding this state into words, we feed it back to the model as the next input embedding directly in the continuous space. This latent reasoning paradigm enables an advanced reasoning pattern, where continuous thoughts can encode multiple alternative next steps, allowing the model to perform a breadth-first search (BFS) rather than committing prematurely to a single deterministic path as in CoT. Coconut outperforms CoT on logical reasoning tasks that require substantial search during planning and achieves a better trade-off between accuracy and efficiency.

For agents

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

get_harvested_code_for_paper("2412.06769")
get_code_for_paper("2412.06769")
have("2412.06769")

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

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

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

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

Connect an agent — have() is free.