SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2402.16061 · 2024

How Large Language Models Encode Context Knowledge? A Layer-Wise Probing Study

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 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; 7 failures of our instrument; 2 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2402.16061.json · badge: /api/ran/2402.16061.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
jometeorie/probing_llama canonical (classifier label)
classifier basis: census
9 ran · 2 no recorded run
FunctionStatusWhere it lives
repeat_kv Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jometeorie/probing_llama/code/llama/modeling_llama.py
pointer only (licence: NONE) · get_code("30d7eec482ebf6b1")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jometeorie/probing_llama/code/custom_llama/modeling_llama.py
pointer only (licence: NONE) · get_code("f725bc2d76076485")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

apply_rotary_pos_emb Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jometeorie/probing_llama/code/llama/modeling_llama.py
pointer only (licence: NONE); the stored copy get_code serves, from Beomi/BitNet-Transformers, is pointer only (licence: NONE) · get_code("37fc3129c3d06e0c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

compute_intermediate_size Ran
ran, honoured the contract we drafted
jometeorie/probing_llama/code/llama/convert_llama_weights_to_hf.py
pointer only (licence: NONE) · get_code("507f475feb734647")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

compute_intermediate_size Ran
ran, honoured the contract we drafted
jometeorie/probing_llama/code/custom_llama/convert_llama_weights_to_hf.py
pointer only (licence: NONE) · get_code("0c540da8d3df6b6e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

import_protobuf Ran
ran; our contract draft was wrong, not the code
jometeorie/probing_llama/code/llama/tokenization_llama.py
pointer only (licence: NONE) · get_code("dfbf610d72061eaf")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

read_json Ran
ran; our contract draft was wrong, not the code
jometeorie/probing_llama/code/custom_llama/convert_llama_weights_to_hf.py
pointer only (licence: NONE) · get_code("c5bcf01d18bba63d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

rotate_half Ran
ran; our contract draft was wrong, not the code
jometeorie/probing_llama/code/custom_llama/modeling_llama.py
pointer only (licence: NONE) · get_code("b99eea6376d1e212")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

train Ran
ran; our contract draft was wrong, not the code
jometeorie/probing_llama/code/probing_model.py
pointer only (licence: NONE) · get_code("86fe730f11e67507")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

write_model Not yet run
unverified (harvested, no recorded run)
jometeorie/probing_llama/code/llama/convert_llama_weights_to_hf.py
pointer only (licence: NONE); the stored copy get_code serves, from Linking-ai/SEED, is pointer only (licence: NONE) · get_code("731285361b7dea0e")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

write_model Not yet run
unverified (harvested, no recorded run)
jometeorie/probing_llama/code/custom_llama/convert_llama_weights_to_hf.py
pointer only (licence: NONE) · get_code("cfeea96bf995824a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, jometeorie/probing_llama when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 distinct functions with an identity, 9 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 6 the same month, 8 later) and 2 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
rotate_half 360 other papers
68 dated earlier, 25 the same month, 258 later, 6 same year, order not determinable, 3 undated · 30 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2302.13971 (2023-02)
LLaMA: Open and Efficient Foundation Language Models
and 357 more not named here
repeat_kv 243 other papers
33 dated earlier, 19 the same month, 187 later, 2 same year, order not determinable, 2 undated · 22 only as an assembly brick
1901.02860 (2019-01)
Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context
2203.08913 (2022-03)
Memorizing Transformers
2305.17888 (2023-05)
LLM-QAT: Data-Free Quantization Aware Training for Large Language Models
and 240 more not named here
apply_rotary_pos_emb 83 other papers
19 dated earlier, 11 the same month, 51 later, 2 same year, order not determinable · 6 only as an assembly brick
2306.15595 (2023-06)
Extending Context Window of Large Language Models via Positional Interpolation
2307.05695 (2023-07)
ReLoRA: High-Rank Training Through Low-Rank Updates
2307.06945 (2023-07)
In-context Autoencoder for Context Compression in a Large Language Model
and 80 more not named here
read_json 21 other papers
9 dated earlier, 1 the same month, 11 later
2210.07316 (2022-10)
MTEB: Massive Text Embedding Benchmark
2304.08177 (2023-04)
Efficient and Effective Text Encoding for Chinese LLaMA and Alpaca
2304.14454 (2023-04)
PMC-LLaMA: Towards Building Open-source Language Models for Medicine
and 18 more not named here
compute_intermediate_size 13 other papers
4 dated earlier, 9 later
2305.13718 (2023-05)
Exploring Self-supervised Logic-enhanced Training for Large Language Models
2307.08072 (2023-07)
Do Emergent Abilities Exist in Quantized Large Language Models: An Empirical Study
2308.16137 (2023-08)
LM-Infinite: Zero-Shot Extreme Length Generalization for Large Language Models
and 10 more not named here
apply_rotary_pos_emb 5 other papers
3 dated earlier, 2 later
2308.10882 (2023-08)
Giraffe: Adventures in Expanding Context Lengths in LLMs
2310.11453 (2023-10)
BitNet: Scaling 1-bit Transformers for Large Language Models
2312.15166 (2023-12)
SOLAR 10.7B: Scaling Large Language Models with Simple yet Effective Depth Up-Scaling
and 2 more not named here
compute_intermediate_size 3 other papers
1 dated earlier, 1 the same month, 1 later
2307.08072 (2023-07)
Do Emergent Abilities Exist in Quantized Large Language Models: An Empirical Study
2402.01618 (2024-02)
Style Vectors for Steering Generative Large Language Models
2405.19298 (2024-05)
Adaptive Image Quality Assessment via Teaching Large Multimodal Model to Compare
write_model 2 other papers
1 dated earlier, 1 later
2401.06706 (2024-01)
Multi-Candidate Speculative Decoding
2406.18200 (2024-06)
SEED: Accelerating Reasoning Tree Construction via Scheduled Speculative Decoding
write_model 1 other paper
1 the same month
2402.01618 (2024-02)
Style Vectors for Steering Generative Large Language Models

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

Previous work has showcased the intriguing capability of large language models (LLMs) in retrieving facts and processing context knowledge. However, only limited research exists on the layer-wise capability of LLMs to encode knowledge, which challenges our understanding of their internal mechanisms. In this paper, we devote the first attempt to investigate the layer-wise capability of LLMs through probing tasks. We leverage the powerful generative capability of ChatGPT to construct probing datasets, providing diverse and coherent evidence corresponding to various facts. We employ $\mathcal V$-usable information as the validation metric to better reflect the capability in encoding context knowledge across different layers. Our experiments on conflicting and newly acquired knowledge show that LLMs: (1) prefer to encode more context knowledge in the upper layers; (2) primarily encode context knowledge within knowledge-related entity tokens at lower layers while progressively expanding more knowledge within other tokens at upper layers; and (3) gradually forget the earlier context knowledge retained within the intermediate layers when provided with irrelevant evidence. Code is publicly available at https://github.com/Jometeorie/probing_llama.

For agents

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

get_harvested_code_for_paper("2402.16061")
get_code_for_paper("2402.16061")
have("2402.16061")

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

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

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

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

Connect an agent — have() is free.