SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2408.03246 · ACL · 2024

Making Long-Context Language Models Better Multi-Hop Reasoners

Liwei Wang, Michael Lyu, Yanyang Li, Shuo Liang

arXiv · PDF · Open in the Atlas

Code that ran

7 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (4 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 3 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/2408.03246.json · badge: /api/ran/2408.03246.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
lavi-lab/longcontextreasoner marked official in Papers with Code
Papers with Code archive
7 ran · 0 no recorded run
FunctionStatusWhere it lives
Evidence Ran
ran on a synthesized input · constructed an object; no result was computed
lavi-lab/longcontextreasoner/common.py
code served (permissive licence) · get_code("88820be8a1a1e750")
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 an instance of its own class, Evidence: the run constructed the object and did not call it, so no result was computed. 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
from dataclasses import dataclass
from typing import List, Optional, Tuple, Dict, Callable

@dataclass(frozen=True)
class Evidence:
    title: str
    sentence: str
    identifier: Optional[str] = None

ARGS = {
    "title": "Sample Evidence Title",
    "sentence": "This is a sample sentence containing evidence.",
    "identifier": "evidence_001"
}
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 Evidence — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Evidence 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
Instance Ran
ran on a synthesized input · constructed an object; no result was computed
lavi-lab/longcontextreasoner/common.py
code served (permissive licence) · get_code("f4be9d5f5352ce94")
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 an instance of its own class, Instance: the run constructed the object and did not call it, so no result was computed. 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.

from dataclasses import dataclass
from typing import List, Optional

@dataclass(frozen=True)
class Evidence:
    title: str
    sentence: str
    identifier: Optional[str] = None

@dataclass(frozen=True)
class Thought:
    rationale: str
    identifier: Optional[str] = None
    quotation: Optional[str] = None

@dataclass(frozen=True, eq=False)
class Instance:
    qid: str
    question: str
    answers: List[str]
    evidences: List[Evidence]
    qtype: Optional[str] = None
    cot: Optional[List[Thought]] = None

# Construct valid arguments
evidence_1 = Evidence(
    title="Wikipedia Article",
    sentence="The capital of France is Paris.",
    identifier="ev_001"
)

evidence_2 = Evidence(
    title="Geography Book",
    sentence="Paris is located in northern France.",
    identifier="ev_002"
)

thought_1 = Thought(
    rationale="The question asks about the capital of France.",
    identifier="th_001",
    quotation="The capital of France is Paris."
)

thought_2 = Thought(
    rationale="Paris is indeed a major city in France.",
    identifier="th_002",
    quotation="Paris is located in northern France."
)

ARGS = {
    "qid": "q_001",
    "question": "What is the capital of France?",
    "answers": ["Paris", "Paris, France"],
    "evidences": [evidence_1, evidence_2],
    "qtype": "factual",
    "cot": [thought_1, thought_2]
}
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 Instance — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Instance 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
PromptTemplate Ran
ran on a synthesized input · constructed an object; no result was computed
lavi-lab/longcontextreasoner/common.py
code served (permissive licence) · get_code("07715f312f69c9d9")
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 an instance of its own class, PromptTemplate: the run constructed the object and did not call it, so no result was computed. 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
from dataclasses import dataclass

torch.manual_seed(0)

ARGS = {
    "instruction": "You are a helpful assistant that answers questions.",
    "question_prefix": "Q: ",
    "question_suffix": "\n",
    "answer_prefix": "A: ",
    "context_prefix": "Context: ",
    "context_suffix": "\n",
    "evidence_template_str": "Evidence: {evidence}",
    "question_first": True,
    "step_template_str": "Step {step_num}: {step_content}",
    "rationale_prefix": "Rationale: ",
    "rationale_suffix": "\n",
}
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 PromptTemplate — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a PromptTemplate 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
Thought Ran
ran on a synthesized input · constructed an object; no result was computed
lavi-lab/longcontextreasoner/common.py
code served (permissive licence) · get_code("b32c2ee36198ee17")
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 an instance of its own class, Thought: the run constructed the object and did not call it, so no result was computed. 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
from dataclasses import dataclass
from typing import List, Optional, Tuple, Dict, Callable

@dataclass(frozen=True)
class Thought:
    rationale: str
    identifier: Optional[str] = None
    quotation: Optional[str] = None

torch.manual_seed(0)

ARGS = {
    "rationale": "This is a test rationale for the thought process.",
    "identifier": "thought_001",
    "quotation": "A relevant quote from the source material."
}
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 Thought — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Thought 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
from_sample_to_instance Ran
ran; our contract draft was wrong, not the code
lavi-lab/longcontextreasoner/common.py
code served (permissive licence) · get_code("2ab175c33301ed89")
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 Instance. 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 dataclasses import dataclass
from typing import List, Optional

@dataclass(frozen=True)
class Evidence:
    title: str
    sentence: str
    identifier: Optional[str] = None

@dataclass(frozen=True)
class Thought:
    rationale: str
    identifier: Optional[str] = None
    quotation: Optional[str] = None

@dataclass(frozen=True, eq=False)
class Instance:
    qid: str
    question: str
    answers: List[str]
    evidences: List[Evidence]
    qtype: Optional[str] = None
    cot: Optional[List[Thought]] = None

# Construct a sample dict with all required fields
sample = {
    'id': 'q001',
    'question': 'What is the capital of France?',
    'answer': ['Paris'],
    'qtype': 'factual',
    'paragraphs': [
        {
            'title': 'France',
            'paragraph_text': 'France is a country in Europe. Paris is the capital of France.'
        },
        {
            'title': 'Europe',
            'paragraph_text': 'Europe is a continent with many countries.'
        }
    ],
    'reasoning_steps': [
        {
            'cot_sent': 'France is a country in Europe.',
            'paragraphs': [
                {
                    'title': 'France',
                    'text_substring': 'France is a country in Europe'
                }
            ]
        },
        {
            'cot_sent': 'Paris is the capital of France.',
            'paragraphs': [
                {
                    'title': 'France',
                    'text_substring': 'Paris is the capital of France'
                }
            ]
        }
    ]
}

ARGS = {
    'sample': sample
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Instance — a Instance output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Instance 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_prompt_from_instance Ran
ran; our contract draft was wrong, not the code
lavi-lab/longcontextreasoner/common.py
code served (permissive licence) · get_code("44d2cdf12ebc2222")
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 str. 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.

from dataclasses import dataclass
from typing import List, Optional

@dataclass(frozen=True)
class Evidence:
    title: str
    sentence: str
    identifier: Optional[str] = None

@dataclass(frozen=True)
class PromptTemplate:
    instruction: str
    question_prefix: str
    question_suffix: str
    answer_prefix: str
    context_prefix: str
    context_suffix: str
    evidence_template_str: str
    question_first: bool
    step_template_str: str
    rationale_prefix: str
    rationale_suffix: str

@dataclass(frozen=True)
class Thought:
    rationale: str
    identifier: Optional[str] = None
    quotation: Optional[str] = None

@dataclass(frozen=True, eq=False)
class Instance:
    qid: str
    question: str
    answers: List[str]
    evidences: List[Evidence]
    qtype: Optional[str] = None
    cot: Optional[List[Thought]] = None

instance = Instance(
    qid="q1",
    question="What is the capital of France?",
    answers=["Paris"],
    evidences=[
        Evidence(
            title="Geography",
            sentence="Paris is the capital of France.",
            identifier="wiki_1"
        ),
        Evidence(
            title="History",
            sentence="France is located in Western Europe.",
            identifier="wiki_2"
        )
    ],
    qtype="factual",
    cot=[Thought(rationale="Paris is known as the capital", identifier="thought_1")]
)

template = PromptTemplate(
    instruction="Answer the following question based on the provided evidence.",
    question_prefix="Question: ",
    question_suffix="\n",
    answer_prefix="Answer: ",
    context_prefix="Evidence:\n",
    context_suffix="\n",
    evidence_template_str="[{identifier}] {title}: {sentence}",
    question_first=True,
    step_template_str="Step {step_number}: {step_content}",
    rationale_prefix="Rationale: ",
    rationale_suffix="\n"
)

ARGS = {
    "instance": instance,
    "template": template
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
quotation_identification Ran
ran; our contract draft was wrong, not the code
lavi-lab/longcontextreasoner/common.py
code served (permissive licence) · get_code("59973ecb913e19ac")
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) and returned list, ndim 2, 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 torch
from dataclasses import dataclass
from typing import List, Optional

@dataclass(frozen=True)
class Evidence:
    title: str
    sentence: str
    identifier: Optional[str] = None

@dataclass(frozen=True)
class PromptTemplate:
    instruction: str
    question_prefix: str
    question_suffix: str
    answer_prefix: str
    context_prefix: str
    context_suffix: str
    evidence_template_str: str
    question_first: bool
    step_template_str: str
    rationale_prefix: str
    rationale_suffix: str

@dataclass(frozen=True)
class Thought:
    rationale: str
    identifier: Optional[str] = None
    quotation: Optional[str] = None

sample = {
    'id': 'q1',
    'question': 'What is the capital of France?',
    'answer': ['Paris'],
    'qtype': 'factual',
    'paragraphs': [
        {
            'title': 'France',
            'paragraph_text': 'Paris is the capital of France and is located in northern France.'
        },
        {
            'title': 'Europe',
            'paragraph_text': 'France is a country in Western Europe.'
        }
    ],
    'reasoning_steps': [
        {
            'cot_sent': 'Paris is mentioned as the capital of France.',
            'paragraphs': [
                {
                    'title': 'France',
                    'text_substring': 'Paris is the capital of France'
                }
            ]
        }
    ]
}

template = PromptTemplate(
    instruction='Answer the following question based on the provided context.',
    question_prefix='Question: ',
    question_suffix='\n',
    answer_prefix='Answer: ',
    context_prefix='Context:\n',
    context_suffix='\n',
    evidence_template_str='{identifier} {title}: {sentence}\n',
    question_first=True,
    step_template_str='Step {identifier}: {quotation}',
    rationale_prefix='Rationale: ',
    rationale_suffix='\n'
)

ARGS = {
    'sample': sample,
    'template': template
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, 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

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

Recent advancements in long-context modeling have enhanced language models (LMs) for complex tasks across multiple NLP applications. Despite this progress, we find that these models struggle with multi-hop reasoning and exhibit decreased performance in the presence of noisy contexts. In this paper, we introduce Reasoning with Attributions, a novel approach that prompts LMs to supply attributions for each assertion during their reasoning. We validate our approach through experiments on three multi-hop datasets, employing both proprietary and open-source models, and demonstrate its efficacy and resilience. Furthermore, we explore methods to augment reasoning capabilities via fine-tuning and offer an attribution-annotated dataset and a specialized training strategy. Our fine-tuned model achieves competitive performance on multi-hop reasoning benchmarks, closely paralleling proprietary LMs such as ChatGPT and Claude-instant 1 .

For agents

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

get_harvested_code_for_paper("2408.03246")
get_code_for_paper("2408.03246")
have("2408.03246")

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

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

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

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

Connect an agent — have() is free.