SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2602.02909 · ICML · 2026

Reasoning About Reasoning: BAPO Bounds on Chain-of-Thought Token Complexity in LLMs

Kiran Tomlinson, Adith Swaminathan, Jennifer Neville, Tobias Schnabel

arXiv · PDF · Open in the Atlas

Code that ran

5 of 7 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; 5 failures of our instrument; 2 no recorded run), measured 2026-11-22; 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/2602.02909.json · badge: /api/ran/2602.02909.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
microsoft/bapo-cot canonical (classifier label)
classifier basis: census
5 ran · 2 no recorded run
FunctionStatusWhere it lives
compute_accs Ran
ran; our contract draft was wrong, not the code
microsoft/bapo-cot/results.py
code served (permissive licence) · get_code("63200532c5af76a9")
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 pandas as pd
import numpy as np

# Create a sample dataframe with the required columns
data = {
    'experiment': ['exp1', 'exp1', 'exp1', 'exp1', 'exp2', 'exp2', 'exp2', 'exp2'],
    'model': ['model_a', 'model_a', 'model_b', 'model_b', 'model_a', 'model_a', 'model_b', 'model_b'],
    'n': [10, 10, 20, 20, 10, 10, 20, 20],
    'correct': [0.85, 0.87, 0.92, 0.90, 0.88, 0.86, 0.94, 0.91]
}
df = pd.DataFrame(data)

experiment_name = 'exp1'
model_name = 'model_a'

ARGS = {
    'df': df,
    'experiment_name': experiment_name,
    'model_name': model_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — 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
get_cots Ran
ran; our contract draft was wrong, not the code
microsoft/bapo-cot/results.py
code served (permissive licence) · get_code("71cac7aa83e58b36")
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 pandas as pd

# Create a sample DataFrame with the required columns
df = pd.DataFrame({
    'experiment': ['exp1', 'exp1', 'exp1', 'exp2', 'exp2', 'exp2'],
    'model': ['model_a', 'model_a', 'model_b', 'model_a', 'model_a', 'model_b'],
    'n': [10, 10, 20, 10, 20, 20],
    'cot': ['reasoning_1', 'reasoning_2', 'reasoning_3', 'reasoning_4', 'reasoning_5', 'reasoning_6']
})

experiment_name = 'exp1'
model_name = 'model_a'

ARGS = {
    'df': df,
    'experiment_name': experiment_name,
    'model_name': model_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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_data Ran
ran; our contract draft was wrong, not the code
microsoft/bapo-cot/plot.py
code served (permissive licence) · get_code("17fe37a2eeec8c1a")
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 tempfile
import os

# Create temporary JSON files with the expected structure
temp_dir = tempfile.mkdtemp()

# Create sample results JSON for "majority" problem
majority_data = [
    {
        "name": "majority_exp_1",
        "model": "gpt-4",
        "model_config": {"temperature": 0.7, "max_tokens": 1000},
        "results": [
            {
                "meta": {
                    "n": 5,
                    "true_answer": True,
                    "num_edges": 10,
                    "numbers": [1, 2, 3, 4, 5]
                },
                "result": {
                    "choices": [
                        {
                            "message": {
                                "parsed": {
                                    "cot": "Let me think about this",
                                    "has_majority_1s": True
                                }
                            }
                        }
                    ],
                    "raw_response": {
                        "usage": {
                            "prompt_tokens": 100,
                            "completion_tokens": 50,
                            "completion_tokens_details": {
                                "reasoning_tokens": 20
                            }
                        }
                    }
                }
            }
        ]
    }
]

# Create sample results JSON for "parity" problem
parity_data = [
    {
        "name": "parity_exp_1",
        "model": "gemini-2.0",
        "model_config": {"temperature": 0.5},
        "results": [
            {
                "meta": {
                    "n": 8,
                    "true_answer": False,
                    "numbers": [2, 4, 6, 8]
                },
                "result": {
                    "choices": [
                        {
                            "message": {
                                "parsed": {
                                    "cot": "Checking parity",
                                    "is_even_parity": False
                                }
                            }
                        }
                    ],
                    "raw_response": {
                        "usage_metadata": {
                            "prompt_token_count": 80,
                            "total_token_count": 150,
                            "thoughts_token_count": 30
                        }
                    }
                }
            }
        ]
    }
]

# Write JSON files
majority_path = os.path.join(temp_dir, 'majority_results_combined.json')
parity_path = os.path.join(temp_dir, 'parity_results_combined.json')

with open(majority_path, 'w') as f:
    json.dump(majority_data, f)

with open(parity_path, 'w') as f:
    json.dump(parity_data, f)

# Change to temp directory so relative paths work
original_dir = os.getcwd()
os.chdir(temp_dir)

# Define arguments for load_data function
ARGS = {
    'problems': ['majority', 'parity']
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
make_df Ran
ran; our contract draft was wrong, not the code
microsoft/bapo-cot/plot.py
code served (permissive licence) · get_code("353137ad6657c18d")
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 DataFrame. 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 pandas as pd
import tempfile
import os

# Create a temporary JSON file with valid results data
temp_dir = tempfile.mkdtemp()
results_file = os.path.join(temp_dir, 'majority_results_combined.json')

# Construct valid test data matching the function's parsing logic
test_data = [
    {
        "name": "experiment_1",
        "model": "gpt-4o",
        "model_config": {"temperature": 0.7, "max_tokens": 1000},
        "results": [
            {
                "meta": {
                    "n": 5,
                    "true_answer": True,
                    "num_edges": 10,
                    "numbers": [1, 2, 3, 4, 5]
                },
                "result": {
                    "choices": [
                        {
                            "message": {
                                "parsed": {
                                    "cot": "Let me think through this step by step",
                                    "has_majority_1s": True
                                }
                            }
                        }
                    ],
                    "raw_response": {
                        "usage": {
                            "prompt_tokens": 50,
                            "completion_tokens": 100,
                            "completion_tokens_details": {
                                "reasoning_tokens": 30
                            }
                        }
                    }
                }
            }
        ]
    },
    {
        "name": "experiment_2",
        "model": "gemini-2.0",
        "model_config": {"temperature": 0.5},
        "results": [
            {
                "meta": {
                    "n": 3,
                    "true_answer": False,
                    "num_edges": 6,
                    "numbers": [2, 4, 6]
                },
                "result": {
                    "choices": [
                        {
                            "message": {
                                "parsed": {
                                    "cot": "Checking parity",
                                    "is_even_parity": False
                                }
                            }
                        }
                    ],
                    "raw_response": {
                        "usage_metadata": {
                            "prompt_token_count": 40,
                            "total_token_count": 140,
                            "thoughts_token_count": 20
                        }
                    }
                }
            }
        ]
    },
    {
        "name": "experiment_3",
        "model": "claude-3-5-sonnet",
        "model_config": {"max_tokens": 2000},
        "results": [
            {
                "meta": {
                    "n": 7,
                    "true_answer": "HELLO",
                    "num_edges": 15,
                    "numbers": [1, 2, 3]
                },
                "result": {
                    "raw_response": {
                        "content": [
                            {"type": "text"},
                            {
                                "parsed_output": {
                                    "cot": "Finding rightmost all caps word",
                                    "rightmost_all_caps_word": "HELLO"
                                }
                            }
                        ],
                        "usage": {
                            "input_tokens": 60,
                            "output_tokens": 120
                        }
                    }
                }
            }
        ]
    }
]

# Write test data to temporary file
with open(results_file, 'w') as f:
    json.dump(test_data, f)

ARGS = {
    'results_path': results_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
make_df Ran
ran; our contract draft was wrong, not the code
microsoft/bapo-cot/results.py
code served (permissive licence) · get_code("f303dafbacbc2d08")
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 DataFrame. 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 tempfile
import os

# Create a temporary JSON file with the expected structure
temp_dir = tempfile.mkdtemp()
results_path = os.path.join(temp_dir, 'majority_results_combined.json')

# Create sample data matching the function's expectations
data = [
    {
        'name': 'experiment_1',
        'model': 'gpt-4',
        'results': [
            {
                'meta': {
                    'n': 5,
                    'true_answer': True
                },
                'result': {
                    'choices': [
                        {
                            'message': {
                                'parsed': {
                                    'cot': 'Let me think about this step by step.',
                                    'has_majority_1s': True
                                }
                            }
                        }
                    ]
                }
            },
            {
                'meta': {
                    'n': 3,
                    'true_answer': False
                },
                'result': {
                    'choices': [
                        {
                            'message': {
                                'parsed': {
                                    'cot': 'Checking the parity.',
                                    'is_even_parity': False
                                }
                            }
                        }
                    ]
                }
            }
        ]
    },
    {
        'name': 'experiment_2',
        'model': 'gpt-3.5',
        'results': [
            {
                'meta': {
                    'n': 7,
                    'true_answer': True
                },
                'result': {
                    'choices': [
                        {
                            'message': {
                                'parsed': {
                                    'cot': 'Analyzing the match.',
                                    'has_match3': True
                                }
                            }
                        }
                    ]
                }
            },
            {
                'meta': {
                    'n': 4,
                    'true_answer': False
                },
                'result': {
                    'choices': [
                        {
                            'message': {
                                'parsed': {
                                    'cot': 'Checking reachability.',
                                    'is_reachable': False
                                }
                            }
                        }
                    ]
                }
            }
        ]
    }
]

# Write the JSON file
with open(results_path, 'w') as f:
    json.dump(data, f)

ARGS = {
    'results_path': results_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
create_provider Not yet run
unverified (harvested, no recorded run)
microsoft/bapo-cot/providers.py
code served (permissive licence) · get_code("e46f6098318fc90a")
How it ran

no invocation recorded.

generate_prompts_for_problem Not yet run
unverified (harvested, no recorded run)
microsoft/bapo-cot/experiments.py
code served (permissive licence) · get_code("d667ccaf0a0890c9")
How it ran

no invocation recorded.

Also present in other papers' code

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

Inference-time scaling via chain-of-thought (CoT) reasoning is a major driver of state-of-the-art LLM performance, but it comes with substantial latency and compute costs. We address a fundamental theoretical question: how many reasoning tokens are required to solve a problem as input size grows? By extending the bounded attention prefix oracle (BAPO) model-an abstraction of LLMs that quantifies the information flow required to solve a task-we prove lower bounds on the CoT tokens required for three canonical BAPO-hard tasks: binary majority, triplet matching, and graph reachability. We show that each requires Ω(n) reasoning tokens when the input size is n. We complement these results with matching or near-matching upper bounds via explicit constructions. Finally, our experiments with frontier reasoning models show approximately linear reasoning token scaling on these tasks and failures when constrained to smaller reasoning budgets, consistent with our theoretical lower bounds. Together, our results identify fundamental bottlenecks in inference-time compute through CoT and offer a principled tool for analyzing optimal reasoning length.

For agents

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

get_harvested_code_for_paper("2602.02909")
get_code_for_paper("2602.02909")
have("2602.02909")

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

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

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

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

Connect an agent — have() is free.