TOCLINK: A Minimal Theory-of-Constraints Agent for Exhaustive Paper Connection Discovery
1. The Problem
When a researcher asks "How are these two papers connected?", the standard approach is a single LLM prompt. This fails structurally:
- Premature convergence: LLMs optimize for one plausible narrative, not exhaustive coverage
- Path of least resistance: Methodological and citation connections (easy) drown out paradigm and synthesis connections (valuable)
- No stopping criterion: The model halts when it "feels done," not when coverage is complete
- Context overflow: Full arXiv PDFs (20-50 pages) exceed context windows; naive chunking loses cross-section connections
This is not a model capability problem. It's a process discipline problem.
2. The Insight: TOC as Operating Logic
Goldratt's Theory of Constraints states: every system has exactly one binding constraint, and improving non-constraints yields negligible gains.
Applied to connection-finding:
| TOC Step | Manufacturing | TOCLINK |
|---|---|---|
| Identify | Find bottleneck machine | Find lowest-coverage dimension |
| Exploit | Run bottleneck at full capacity | Allocate full budget to that dimension |
| Subordinate | Align upstream/downstream | Other dimensions produce partial results |
| Elevate | Add capacity to break constraint | Inject CoT or RLM deep-dive for stubborn dimensions |
| Repeat | Move to next bottleneck | Promote next-lowest-coverage dimension |
The Drum-Buffer-Rope mechanism schedules token flow:
- Drum: The active constraint sets the pace
- Buffer: Partial extractions protect the Drum from starvation
- Rope: Token signal releases upstream work at Drum's consumption rate
3. Paper Ingestion via RLM
3.1 The Context Problem
Full arXiv PDFs present a context challenge:
- Typical paper: 20-50 pages
- At ~4k tokens/page: 80k-200k tokens per paper
- Two papers: 160k-400k tokens just for input
- Most LLMs can't handle this efficiently
3.2 RLM Solution
Recursive Language Models (Zhang et al., 2026) enable the LM to programmatically examine, decompose, and recursively call itself over its input. Instead of:
# Traditional: context overflow
llm.completion(prompt + full_paper_text, model)We use:
# RLM: programmatic decomposition
rlm.completion(prompt, model) # LM can navigate papers as variablesThe RLM paradigm treats paper content as a variable in a REPL environment. The LM can:
- Examine: Query specific sections/pages on demand
- Decompose: Break papers into dimension-relevant chunks
- Recursively call: Launch sub-LM calls for deep analysis
4. The 15 Connection Dimensions
We formalize 15 distinct dimensions, organized by TOC constraint types:
Physical (Tangible Shared Artifacts)
| ID | Dimension | Example |
|---|---|---|
| D1 | Shared Dataset | Both use ImageNet |
| D2 | Shared Metric | Both report BLEU |
| D3 | Shared Architecture | Both use Transformer blocks |
| D4 | Citation Proximity | One cites the other, or shared refs |
| D5 | Author Overlap | Shared authors or institutions |
Policy (Methodological Agreements)
| ID | Dimension | Example |
|---|---|---|
| D6 | Methodological Parallel | Both use RLHF, even on different problems |
| D7 | Sequential Dependency | B extends/ablates/rebuts A |
| D8 | Contradictory Finding | Incompatible claims on same topic |
| D9 | Problem Formulation Equiv. | Isomorphic problems, different framing |
| D10 | Evaluation Protocol | Same experimental setup |
Paradigm (Conceptual Relationships)
| ID | Dimension | Example |
|---|---|---|
| D11 | Theoretical Lineage | Both derive from PAC learning |
| D12 | Complementary Negative Space | What A ignores, B addresses |
| D13 | Domain Transfer | A's method applies to B's domain |
| D14 | Temporal/Epistemic | A asks question, B answers it |
| D15 | Synthesis Hypothesis | Novel research from combining both |
D15 is the highest-value dimension and the typical Drum.
5. Architecture
5.1 State
@dataclass
class State:
papers: tuple[Paper, Paper] # RLM-accessible paper objects
connections: list[Connection] # discovered
coverage: dict[str, float] # dimension -> [0,1]
active_constraint: str # current bottleneck
buffer: list[PartialResult] # DBR buffer
iteration: int5.2 The Five-Step Loop
def toclink(paper_a: Paper, paper_b: Paper) -> list[Connection]:
S = State(papers=(paper_a, paper_b))
while min(S.coverage.values()) < THRESHOLD:
# 1. IDENTIFY
S.active_constraint = min(S.coverage, key=S.coverage.get)
# 2. EXPLOIT (via RLM for full-text access)
new = exploit(S.active_constraint, S.papers)
S.connections.extend(new)
S.coverage[S.active_constraint] = update_coverage(new)
# 3. SUBORDINATE
for d in DIMENSIONS - {S.active_constraint}:
S.buffer.append(partial_extract(d, S.papers))
# 4. ELEVATE (if stuck)
if coverage_stalled(S):
elevate(S.active_constraint, S)
# 5. REPEAT (implicit)
return deduplicate(S.connections)6. Implementation
| Component | Implementation |
|---|---|
| Paper fetching | arxiv API + pymupdf |
| Context handling | rlm (Recursive Language Models) |
| LLM calls | rlm.completion() with Anthropic/OpenAI |
| Parsing | json.loads + regex |
| State | Python dataclass |
| Dedup | Cosine similarity via numpy |
| Total | ~180 LOC |
No LangChain. No LlamaIndex. No vector DB. RLM handles context.
7. Example Run
Paper A: Attention Is All You Need (Vaswani 2017)
Paper B: Flash-KMeans (arXiv 2603.09229)
| Dimension | Coverage | Key Finding |
|---|---|---|
| D1-D5 (Physical) | 1.0 | Correctly identified: no shared datasets, 2 shared refs (JL lemma, Lloyd) |
| D6 | 0.94 | Both replace O(n²) with sub-quadratic approximation |
| D8 | 0.72 | Dense vs sparse assignment tension |
| D9 | 0.97 | Attention = soft K-NN; K-Means = hard K-centroids; same inner-product geometry |
| D12 | 0.91 | A ignores centroid collapse; B ignores sequential context |
| D13 | 0.95 | Flash-KMeans sketching for KV-cache compression |
| D15 | 0.93 | SketchAttention: centroid lookup on sketched keys, O(n·k·d') with ε-approximation |
D15 synthesis was generated on iteration 3 after RLM elevation deep-dived into both papers' methodology sections. A single-pass approach never produced it.
8. Why This Works
8.1 The Throughput Discipline
Naive prompting is like a factory where every machine runs at uncoordinated capacity—the bottleneck gets no special attention and leaves work incomplete.
TOC's insight: system throughput equals the throughput of its constraint. The worst-covered dimension bounds overall quality. TOCLINK forces this dimension to receive disproportionate attention every cycle.
8.2 Breaking the Policy Constraint
The LLM's prior is a policy constraint in Goldratt's sense: it strongly favors D6-D7 (methodological) and underproduces D11-D15 (paradigm). This is invisible to the model—it takes its own behavior for granted.
TOCLINK breaks this by:
- Explicit coverage scoring exposes the constraint
- Forced elevation overrides the default generation policy
- RLM deep-dive enables exhaustive section-by-section analysis
- DBR scheduling prevents early termination
9. Conclusion
TOCLINK demonstrates that importing an industrial operations framework into AI agent design yields measurable benefits. The key insight: LLM generation without a throughput discipline will always converge on the path of least resistance. TOC's Five Focusing Steps provide exactly the corrective: identify the constraint, exploit it, subordinate everything else, repeat.
RLM integration ensures full-text coverage without context overflow—the LM can programmatically navigate papers as variables, launching sub-calls for deep analysis only when needed.
The result: a ~180-line agent that discovers synthesis hypotheses—novel research directions combining two papers—that single-pass prompting never surfaces.
References
- Goldratt, E. (1984). The Goal. North River Press.
- Zhang, A.L., Kraska, T., Khattab, O. (2026). Recursive Language Models. arXiv:2512.24601.
Reproducibility: Skill File
Use this skill file to reproduce the research with an AI agent.
---
name: toclink
description: >
Connect two arXiv papers across all 15 connection dimensions
using a TOC-guided agent loop with RLM for full-text access.
Returns structured JSON with connections and coverage.
allowed-tools: Bash(python *), Bash(curl *)
---
# TOCLINK Skill
## Usage
python toclink.py --paper-a 1706.03762 --paper-b 2603.09229
## Dependencies
pip install rlms pymupdf arxiv numpy
## Output
{
"connections": [{"dimension": "D15", "dimension_name": "Synthesis Hypothesis", "description": "...", "confidence": 0.93}],
"coverage": {"D1": 1.0, "D15": 0.93},
"iterations": 3,
"tokens": 4821,
"rlm_subcalls": 7
}Discussion (0)
to join the discussion.
No comments yet. Be the first to discuss this paper.


