SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.12775 · EMNLP · 2024

Hopping Too Late: Exploring the Limitations of Large Language Models on Multi-Hop Queries

Amir Globerson, Sohee Yang, Mor Geva, Eden Biran, Daniela Gottesman

arXiv · PDF · Open in the Atlas

Code that ran

10 of 12 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; 2 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 8 failures of our instrument; 2 no recorded run), measured 2026-11-23; 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/2406.12775.json · badge: /api/ran/2406.12775.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
edenbiran/HoppingTooLate canonical (classifier label)
classifier basis: census
10 ran · 2 no recorded run
FunctionStatusWhere it lives
create_target_prompt Ran
ran; our contract draft was wrong, not the code
edenbiran/HoppingTooLate/src/patch_activations.py
code served (permissive licence) · get_code("0bad694c005e385c")
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 Series. 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 minimal DataFrame that satisfies the function's requirements
dataset = pd.DataFrame({
    'source_prompt': [
        'The capital of France is Paris',
        'The capital of Germany is Berlin'
    ],
    'e1_label': ['France', 'Germany'],
    'e1_template': ['{}', '{}'],
    'r1_template': ['capital of {}', 'capital of {}'],
    'r2_template': ['largest city of {}', 'largest city of {}']
})

ARGS = {
    'dataset': dataset,
    'source': 'e1',
    'target': 'composition'
}
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 Series — a Series output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Series 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
find_layers_by_classification Ran
ran, honoured the contract we drafted
edenbiran/HoppingTooLate/src/classify_results.py
code served (permissive licence) · get_code("3820700493cb2dd1")
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 pandas as pd
import numpy as np

# Create a sample DataFrame that matches the expected structure
# The function expects a DataFrame with columns: 'id', 'classification', and either 'layer' or 'source_layer'
classified_generations = pd.DataFrame({
    'id': [1, 1, 1, 2, 2, 2],
    'classification': ['typeA', 'typeA', 'typeB', 'typeA', 'typeB', 'typeB'],
    'layer': [0, 1, 2, 0, 1, 2]
})

ARGS = {
    'classified_generations': classified_generations,
    'classification': 'typeA',
    'col_name': 'min_layer',
    'apply_min': True
}
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 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 int 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_entities_per_type Ran
ran; our contract draft was wrong, not the code
edenbiran/HoppingTooLate/src/create_dataset.py
code served (permissive licence) · get_code("e3649917ac1cd8d7")
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.

# Analyze the function
# get_entities_per_type takes:
# - ent_type: a string representing an entity type (used in SPARQL query)
# - k: an integer for LIMIT (default 1)
# - offset: an integer for OFFSET (default 0)
# The function constructs and returns a SPARQL query string

# Setup valid arguments
ARGS = {
    'ent_type': 'Q5',  # Wikidata entity type (e.g., "human")
    'k': 10,
    'offset': 5
}
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
get_entity_counts Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
edenbiran/HoppingTooLate/src/analyze_results.py
code served (permissive licence) · get_code("c932a81e28f8b5ec")
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 pandas as pd
import numpy as np

# Create a simple DataFrame with the required columns
# The function accesses: 'e1_e2_entity_layer', 'last_e2_entity_layer', and 'last_e3_entity_layer'
# It calls .count() on each column and divides by len(df)

df = pd.DataFrame({
    'e1_e2_entity_layer': [1, 2, np.nan, 4],
    'last_e2_entity_layer': [5, np.nan, 7, 8],
    'last_e3_entity_layer': [9, 10, np.nan, np.nan]
})

ARGS = {
    'df': df
}
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 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
get_layer_names Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
edenbiran/HoppingTooLate/src/utils.py
code served (permissive licence) · get_code("cdc175a60f83d924")
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 list, ndim 1, 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 transformers import GPT2Config, LlamaConfig, GemmaConfig
from transformers.models.gpt2.modeling_gpt2 import GPT2LMHeadModel
from transformers.models.llama.modeling_llama import LlamaForCausalLM
from transformers.models.gemma.modeling_gemma import GemmaForCausalLM

torch.manual_seed(0)

# Create a minimal GPT2LMHeadModel
gpt2_config = GPT2Config(
    vocab_size=50257,
    n_positions=1024,
    n_embd=32,
    n_layer=2,
    n_head=2,
)
gpt2_model = GPT2LMHeadModel(gpt2_config)

# Create a minimal LlamaForCausalLM
llama_config = LlamaConfig(
    vocab_size=32000,
    hidden_size=32,
    num_hidden_layers=2,
    num_attention_heads=2,
    intermediate_size=64,
)
llama_model = LlamaForCausalLM(llama_config)

# Create a minimal GemmaForCausalLM
gemma_config = GemmaConfig(
    vocab_size=256000,
    hidden_size=32,
    num_hidden_layers=2,
    num_attention_heads=2,
    intermediate_size=64,
)
gemma_model = GemmaForCausalLM(gemma_config)

ARGS = {
    "model": gpt2_model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, 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
get_one_hop Ran
ran; our contract draft was wrong, not the code
edenbiran/HoppingTooLate/src/create_dataset.py
code served (permissive licence) · get_code("97485dbb4fcb5def")
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.

# Analyze the function
# The function get_one_hop takes a single parameter 'ent' (entity)
# It uses this parameter in an f-string to construct a SPARQL query
# The parameter is expected to be a string representing an entity identifier

ARGS = {
    'ent': 'wd:Q42'
}
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
get_popular_entities_per_type Ran
ran; our contract draft was wrong, not the code
edenbiran/HoppingTooLate/src/create_dataset.py
code served (permissive licence) · get_code("4fd83ad38d7e72b8")
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.

# Analysis: This function constructs a SPARQL query string for Wikidata.
# It takes:
# - ent_type: a string representing a Wikidata entity type (e.g., "Q5" for human)
# - k: an integer for LIMIT (default 1)
# - offset: an integer for OFFSET (default 0)
# The function simply formats these into a query string and returns it.

ARGS = {
    'ent_type': 'Q5',
    'k': 10,
    'offset': 0
}
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
get_stage_layers Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
edenbiran/HoppingTooLate/src/analyze_results.py
code served (permissive licence) · get_code("e12cea8b6661a026")
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 pandas as pd
import numpy as np

# Create a sample DataFrame with the required columns
# The function expects columns: 'e1_e2_entity_layer', 'info_prop', 'last_e3_entity_layer', 'mlp_prediction_projection_layers'
# These should contain numeric values that can be counted and averaged

df = pd.DataFrame({
    'e1_e2_entity_layer': [1.5, 2.3, 3.1, np.nan, 1.8],
    'info_prop': [2.1, np.nan, 3.5, 1.9, 2.7],
    'last_e3_entity_layer': [0.5, 1.2, np.nan, 0.8, 1.1],
    'mlp_prediction_projection_layers': [3.2, 2.8, 1.5, 2.9, np.nan]
})

ARGS = {
    'df': df
}
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 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
get_sublayer_counts Ran
ran, honoured the contract we drafted
edenbiran/HoppingTooLate/src/analyze_results.py
code served (permissive licence) · get_code("9ca91681e0ed00b8")
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 pandas as pd
import numpy as np

# Create a sample DataFrame with the required columns
# The function expects columns like 'attention_{target}_projection_layers' and 'mlp_{target}_projection_layers'
# These columns should contain lists/arrays of layer numbers that can be exploded

data = {
    'attention_output_projection_layers': [
        [1, 2, 3],
        [2, 3],
        [1, 2],
        [1]
    ],
    'mlp_output_projection_layers': [
        [1, 2],
        [1, 2, 3, 4],
        [2],
        [1, 2, 3]
    ]
}

df = pd.DataFrame(data)

target = 'output'

ARGS = {
    'df': df,
    'target': target
}
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 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
load_tokenizer Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
edenbiran/HoppingTooLate/src/utils.py
code served (permissive licence) · get_code("8164e26307c3a60b")
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 Mock. 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 unittest.mock import Mock, MagicMock

torch.manual_seed(0)

# The function load_tokenizer takes model_name as parameter
# It calls AutoTokenizer.from_pretrained(model_name, token=HF_TOKEN)
# and then sets tokenizer.pad_token = tokenizer.eos_token
# So we need to provide a valid model_name string

# Create a mock tokenizer that will be returned by AutoTokenizer.from_pretrained
mock_tokenizer = Mock()
mock_tokenizer.pad_token = None
mock_tokenizer.eos_token = "<|endoftext|>"

# Patch AutoTokenizer.from_pretrained to return our mock tokenizer
from transformers import AutoTokenizer
original_from_pretrained = AutoTokenizer.from_pretrained

def mock_from_pretrained(model_name, token=None):
    return mock_tokenizer

AutoTokenizer.from_pretrained = mock_from_pretrained

# Define arguments for load_tokenizer
ARGS = {
    'model_name': 'gpt2'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Mock — a Mock output has no array shape of its own; none is 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
find_tokens Not yet run
unverified (harvested, no recorded run)
edenbiran/HoppingTooLate/src/patched_generation.py
code served (permissive licence) · get_code("5c1337c4e1ef4149")
How it ran

no invocation recorded.

load_model Not yet run
unverified (harvested, no recorded run)
edenbiran/HoppingTooLate/src/utils.py
code served (permissive licence) · get_code("9d02aac80c0eae1a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 12 samples lifted from this paper's linked repositories, 12 carry a function identity and 0 do not. Of the 12 distinct functions with an identity, 4 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 4 later) and 8 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.

FunctionAlso present inEarliest-datedOthers named
find_layers_by_classification 1 other paper
1 later
2503.16356 (2025-03)
CaKE: Circuit-aware Editing Enables Generalizable Knowledge Learners
find_tokens 1 other paper
1 later
2503.16356 (2025-03)
CaKE: Circuit-aware Editing Enables Generalizable Knowledge Learners
load_model 1 other paper
1 later
2503.16356 (2025-03)
CaKE: Circuit-aware Editing Enables Generalizable Knowledge Learners
load_tokenizer 1 other paper
1 later
2503.16356 (2025-03)
CaKE: Circuit-aware Editing Enables Generalizable Knowledge Learners

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) can solve complex multi-step problems, but little is known about how these computations are implemented internally. Motivated by this, we study how LLMs answer multi-hop queries such as "The spouse of the performer of Imagine is". These queries require two information extraction steps: a latent one for resolving the first hop ("the performer of Imagine") into the bridge entity (John Lennon), and another for resolving the second hop ("the spouse of John Lennon") into the target entity (Yoko Ono). Understanding how the latent step is computed internally is key to understanding the overall computation. By carefully analyzing the internal computations of transformer-based LLMs, we discover that the bridge entity is resolved in the early layers of the model. Then, only after this resolution, the two-hop query is solved in the later layers. Because the second hop commences in later layers, there could be cases where these layers no longer encode the necessary knowledge for correctly predicting the answer. Motivated by this, we propose a novel "back-patching" analysis method whereby a hidden representation from a later layer is patched back to an earlier layer. We find that in up to 66% of previously incorrect cases there exists a back-patch that results in the correct generation of the answer, showing that the later layers indeed sometimes lack the needed functionality. Overall, our methods and findings open further opportunities for understanding and improving latent reasoning in transformer-based LLMs.

For agents

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

get_harvested_code_for_paper("2406.12775")
get_code_for_paper("2406.12775")
have("2406.12775")

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

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

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

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

Connect an agent — have() is free.