Gorio Tech Blog search

Beyond Context Limits: Subconscious Threads for Long-Horizon Reasoning | Summary

한국어로 읽기

|
Contents

This article explains the key points of Beyond Context Limits: Subconscious Threads for Long-Horizon Reasoning.

  • 2025-07-22 (arXiv)
  • Luo, Hongyin, Morgan, Nathaniel, Li, Tina, Zhao, Derek, Ngo, Ai Vy, Schroeder, Philip, Yang, Lijie, Ben-Kish, Assaf, O’Brien, Jack, Glass, James.
  • MIT CSAIL, Subconscious Systems Technologies, Inc., Princeton University, Tel Aviv University
  • Paper
  • Github
  • Project Page

Read this article in Korean


Summary

  • Long reasoning workflows can exhaust a large language model’s context window, the token history available for its next prediction, because completed subtasks and tool responses accumulate. The Thread Inference Model (TIM), trained to generate recursive task trees, and its inference runtime TIMRUN achieve peak cached context 51.6–64.1% shorter than total output length across six reasoning benchmarks, with mixed but broadly preserved accuracy compared with the same TIM-8b model served without pruning on SGLang, a language-model serving system.
  • Each task records its reasoning, optional tool use, optional subtasks, and conclusion in JSON, a structured data format that makes task boundaries machine-readable. TIMRUN removes completed subtask details from the key/value (KV) cache, the stored attention states used during generation, while retaining higher-level conclusions. It re-encodes subsequent tokens to reuse positional embeddings, which represent token positions.
  • On 140 Datacommons QA questions, which require information retrieval through a search tool, TIM matches the earlier recursive-task framework THREAD at 67.9% accuracy without THREAD’s task-specific prompt of over 4,000 tokens and two examples. Runtime experiments show higher throughput than SGLang with suitable pruning buffers, which temporarily retain completed subtask lists. The study remains preliminary: synthetic training responses were generated without executing tools, browsing success is low, and the experiments do not establish unlimited reliable reasoning.

1 Introduction

The introduction identifies two connected bottlenecks: retaining a growing linear reasoning history consumes context and memory, while distributing tasks across multiple model instances requires explicit coordination, context management, and tool-response handling. The proposed alternative represents reasoning as a recursive task tree whose completed branches can be removed once their results have been aggregated into conclusions. Its central assumption is that later tasks usually need those conclusions rather than every internal step of earlier subtasks.

Completed subtask branches leave active context after their outputs have been aggregated into a parent-level result. The diagram illustrates the assumption that these retained results suffice for later reasoning; it does not test whether discarded details are unnecessary.

Full-history attention compared with attention over working memory that retains aggregated task results.
Full-history attention compared with attention over working memory that retains aggregated task results.

2 THREAD Inference Model (TIM)

TIM is a transformer-based language model, using attention over available context, trained to decompose tasks recursively and aggregate their results from the leaves upward. The model supplies a parseable reasoning structure, and TIMRUN uses that structure to manage memory and external tool execution within one continuing inference request.

2.1 Thread-2

Thread-2, the paper’s revised recursive reasoning format, gives every task the same fields: thought for reviewing progress and planning, tooluse for an optional external call, subtasks for an optional recursive task list, and conclusion for the result needed by later reasoning. Unlike the earlier Thread framework, subtasks access shared working memory containing the system prompt, user input, and all unpruned tasks.

  • Completed subtask lists enter a fixed-size pruning buffer. When its threshold is exceeded, the earliest list is removed from working memory; this section specifies thresholds among {0, 1, 2}.
  • Constrained decoding, which restricts generation to a prescribed schema, produces recursive JSON without special structure tokens or separate model calls for each subtask.
  • When generation reaches tool_result, the runtime extracts the preceding parameters, executes the tool, and encodes its returned JSON into the continuing context.

The recursive Task schema exposes the boundaries needed for pruning, while ToolUse exposes the tool name, parameters, and returned result needed for runtime execution. The same parsing mechanism can therefore operate at different recursion depths.

Pydantic data-model classes defining recursive reasoning tasks and example search and webpage-reading tool schemas.
Pydantic data-model classes defining recursive reasoning tasks and example search and webpage-reading tool schemas.

2.2 Training (Preview)

Supervised fine-tuning, training on example responses, teaches Qwen3-8b to generate Thread-2 structures using questions drawn from 20k openr1-math-220k mathematical examples, 20k research questions, and 6k ToolBench tool-use questions. Mathematical examples prohibit tools, research examples allow search and webpage reading, and tool-use examples supply synthesized input/output schemas. Language models generate both the reasoning and simulated tool responses, which the authors explicitly identify as a source of questionable data quality.

  • The resulting synthetic data are used to train Qwen3-8b with LlamaFactory, a model fine-tuning framework.
  • Subsequent reinforcement learning, training from rewards, uses the GRPO optimization method on the remaining openR1-math-220k questions. JSON constraints remain active during sampling, and rewards compare predicted answers with annotated answers.
  • The authors report that this reward-based stage improves the fine-tuned model despite noisy supervised data, but provide no separate quantitative comparison isolating that training stage.

3 TIMRUN, the Inference Runtime for TIM

TIMRUN addresses the deployment problem created by placing a continuing reasoning workflow in the model’s output stream. Removing cached tokens frees memory but does not by itself reset token positions, so the runtime must recycle both graphics processing unit (GPU) memory and positional embeddings. The paper illustrates the motivation with Qwen 2.5’s stated 128k-token input limit and 32k-token output limit.

3.1 Subtask Pruning

TIMRUN removes completed subtask states before attention computation, rather than manipulating memory inside the model’s forward pass, the computation producing its next prediction. It uses paged attention, which manages cached attention states through memory pages, with page size 1 to support different pruning decisions across requests. Batched pruning is implemented with Triton, a GPU programming tool, and FlashInfer, an attention engine, accelerates inference with these single-token pages.

  • After deleting a subtask, the runtime re-encodes the retained tokens that follow it against the unchanged prefix. This assigns them earlier positions and makes positional capacity available for further generation.
  • Re-encoding adds computation, but the affected tokens can be processed in parallel. Whether pruning improves throughput depends on balancing this work and memory management against reduced attention over a shorter cache.
  • The pruning buffer temporarily retains completed subtask lists to provide redundancy before their details are discarded. Continued reasoning depends on suitable task decomposition and informative retained conclusions.

While Task 2 is being decoded, Tasks 1.1.1 and 1.1.2, including their tool interaction, have been removed. Tasks 1.1 and 1.2 can remain temporarily available in the pruning buffer even though their results have already been aggregated into Task 1’s conclusion.

A recursive task trajectory showing retained task information, buffered completed subtasks, and pruned descendants.
A recursive task trajectory showing retained task information, buffered completed subtasks, and pruned descendants.

3.2 End-to-End Multi-Hop Tool Use

Multi-hop tool use, a sequence of tool interactions whose results inform subsequent steps, ordinarily requires repeatedly submitting an expanding message history. TIMRUN instead executes tools directly from generated parameters and appends their responses to the ongoing inference, reducing repeated client-to-runtime transmission.

  • Prefilling means encoding the initial input and storing its attention states; extending means encoding additional tokens against a cached prefix. Prefix caching can avoid recomputation, but repeated submissions still introduce transmission and cache-management overhead.
  • The paper argues that repeated charging for cached history can yield approximately quadratic token costs in some workflows that submit each reasoning step as a new request. This is a conditional argument about request organization and pricing, rather than a measured universal cost reduction.
  • Tool execution can wait for a response without pausing other requests in the inference batch.

Moving tool execution into TIMRUN removes the client’s repeated submission of history with each tool response. The communication paths explain the proposed reduction in transmission, but do not quantify monetary savings or end-to-end latency.

Client-mediated tool interactions in traditional inference runtimes compared with runtime-managed tool interactions in TIMRUN.
Client-mediated tool interactions in traditional inference runtimes compared with runtime-managed tool interactions in TIMRUN.

4 Experiments

The experiments examine reasoning accuracy, tool-based information retrieval, and inference throughput. The most direct accuracy comparison uses the same TIM-8b model with structured output on both serving systems: SGLang retains the reasoning history, whereas TIMRUN adds subtask pruning, memory-page management, and sequence re-encoding. Research-task comparisons also vary prompting, model, or interaction paradigm, so they provide less direct isolation of the runtime’s contribution.

4.1 Reasoning

Across MATH500, MMLU-STEM500, AMC 2022, AMC 2023, AIME 2024, and GPQADiamond, benchmarks testing mathematical reasoning or science and technical knowledge, pruning produces mixed accuracy changes. SGLang versus TIMRUN scores are respectively 69.6% versus 69.0%, 88.4% versus 87.6%, 60.5% versus 60.5%, 80.0% versus 80.0%, 40.0% versus 46.7%, and 44.9% versus 48.5%.

  • Reported KV Pruned values are respectively 53.3%, 51.6%, 57.1%, 58.7%, 64.1%, and 54.2%, calculated as 1 − max_cache/output_len.
  • On AIME 2024, the reported maximum cache length is 3218.6 tokens against an output length of 8974.7 tokens. Active cached context is therefore substantially shorter than total generated history.
  • The metric compares peak cache length with full output length; it does not measure average memory use or total GPU allocation. The table provides no uncertainty estimates for the accuracy differences.

Using the same TIM-8b model makes this the paper’s most direct comparison of serving with and without pruning. All six tasks show reported cache reductions above 50%; accuracy declines slightly on two tasks, remains unchanged on two, and increases on two.

Reasoning accuracy, maximum cache length, output length, and reported cache-pruning percentage for TIM-8b served with SGLang and TIMRUN.
Reasoning accuracy, maximum cache length, output length, and reported cache-pruning percentage for TIM-8b served with SGLang and TIMRUN.

4.2 Research

On Datacommons QA, TIM receives a search tool and is evaluated on 140 questions without training on that specific tool. It achieves 67.9% accuracy, matching THREAD and exceeding the table’s other prompting-based baselines, Reflection, NLEP+ReACT, and DecomP, at 24.3%, 27.1%, and 57.9%, respectively. TIM uses a concise system message and tool specifications, whereas THREAD uses over 4,000 prompt tokens and two task-specific examples.

TIM ties THREAD at 67.9% on Datacommons QA without its task-specific examples and long prompt. The table establishes comparable accuracy under different prompting requirements, but supplies no direct timing or token-cost measurement.

Datacommons QA accuracy for Reflection, NLEP+ReACT, DecomP, THREAD, and TIM.
Datacommons QA accuracy for Reflection, NLEP+ReACT, DecomP, THREAD, and TIM.

BrowseComp tests web research requiring decomposition, retrieval, and verification against question conditions. TIM-large, a GPT-4.1-based implementation of the recursive JSON pipeline with pruning that is not served on TIMRUN, achieves 7.8% success; TIM-8b achieves 2.3%, GPT-4o with browsing 1.9%, and Deepseek-R1 using the ReACT reasoning-and-tool-interaction paradigm 9.5%.

  • TIM-large is a prompted GPT-4.1 system rather than a larger trained TIM checkpoint, so its score does not establish how TIM training scales with model size.
  • Different underlying models and interaction paradigms prevent attribution of the browsing differences to pruning alone. TIM-large remains below Deepseek-R1 in the reported table.
  • The absence of BrowseComp-specific post-training should be distinguished from TIM-8b’s earlier training on research questions and synthetic tool-use examples.

TIM-large scores above GPT-4o browsing and below Deepseek-R1 with ReACT, while TIM-8b exceeds GPT-4o by 0.4 percentage points. Model identity and interaction paradigm both vary, so the results do not isolate the effect of Thread-2 or TIMRUN.

BrowseComp success rates across models and interaction paradigms without browsing-specific post-training.
BrowseComp success rates across models and interaction paradigms without browsing-specific post-training.

4.3 Efficiency and Scalability

A naive implementation shows why cache reduction alone is insufficient: with batch size 1 and eager attention, the standard attention implementation used in this test, Hugging Face Transformers throughput falls from 22 to 18 tokens per second when pruning is added. On AIME 2024 with batch size 30, TIMRUN exceeds SGLang’s throughput with pruning-buffer sizes 1 and 2, but falls below it at size 3. The authors identify size 2 as a useful accuracy-throughput compromise.

  • On BrowseComp, Figure 5b shows a comparatively shallow throughput decline for TIMRUN as tool calls increase, whereas SGLang’s decline is steeper. The text also reports support for more than 30 tool calls in one inference.
  • The abstract claims sustained throughput while manipulating up to 90% of the KV cache, but the main experimental presentation supplies no detailed sweep corresponding to that claim.
  • The paper does not specify GPU hardware, numerical precision, or a comprehensive serving configuration for reproducing throughput measurements. It also presents no larger-batch capacity experiment despite raising that question.

Panel (a) shows a conditional speed benefit: pruning-buffer sizes 1 and 2 exceed the SGLang baseline, whereas size 3 does not. Panel (b) shows a weaker throughput decline as tool calls increase for TIMRUN, consistent with its removal of accumulated subtask details and tool responses.

Throughput versus pruning-buffer size on AIME 2024 and throughput versus tool-call count on BrowseComp.
Throughput versus pruning-buffer size on AIME 2024 and throughput versus tool-call count on BrowseComp.

5 Conclusion

The conclusion attributes the system’s benefits to co-design: TIM emits recursive task boundaries and conclusions, and TIMRUN uses them for pruning, batching, and tool integration. The reported evidence supports reducing active cached context while broadly preserving benchmark accuracy and improving throughput under selected settings. The implementation reference is https://github.com/subconscious-systems/TIMRUN.

Appendix

  • The supplied 13-page research preview contains no appendix. References follow the conclusion on pages 11–13.

Brief Thoughts

The clearest contribution is the connection between generated task structure and runtime memory management: completed branches become identifiable units for cache removal and position reuse. Table 1 supports substantial cache reduction with small declines, ties, or gains in accuracy, while Figure 5 shows that implementation efficiency and pruning-buffer choice determine whether that reduction improves speed. Claims of virtually unlimited reasoning and lossless information flow exceed the demonstrated evidence because the study provides neither a controlled evaluation across increasing reasoning horizons nor a direct test of information lost through pruning.