SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2605.08942 · 2026

Decomposing and Steering Functional Metacognition in Large Language Models

Haibo Zhang, Anxiang Zeng, Xueru Bai, Yanshi Li, Shuman Liu

arXiv · PDF

Code that ran

9 of 9 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; 0 honoured the contract we drafted, 1 violated it and 0 have no contract verdict; 8 failures of our instrument; 0 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/2605.08942.json · badge: /api/ran/2605.08942.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
xlands/meta-cognition canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
create_prompt_pairs Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/01_generate_prompts.py
code served (permissive licence) · get_code("4c8a2f426ad9936a")
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 random

ARGS = {
    'dim_name': 'sentiment',
    'dim_config': {
        'positive_templates': [
            'Positive perspective on: {question}',
            'Optimistic view: {question}',
            'Supporting: {question}'
        ],
        'negative_templates': [
            'Negative perspective on: {question}',
            'Critical view: {question}',
            'Opposing: {question}'
        ]
    },
    'questions': [
        {
            'question': 'Is this product good?',
            'answer': 'Yes, it is excellent.'
        },
        {
            'question': 'Should we invest in this?',
            'answer': 'Yes, it is a sound investment.'
        }
    ],
    'seed': 42
}
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 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_transformer_layers Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/03_steer_activations.py
code served (permissive licence) · get_code("5a7255fa547d028c")
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 ModuleList. 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 torch.nn as nn

torch.manual_seed(0)

# Test case 1: Model with model.model.layers structure
class TransformerLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

class ModelWithModelLayers(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([
            TransformerLayer(),
            TransformerLayer()
        ])
    
    def forward(self, x):
        return x

# Test case 2: Model with transformer.h structure
class ModelWithTransformerH(nn.Module):
    def __init__(self):
        super().__init__()
        self.transformer = nn.Module()
        self.transformer.h = nn.ModuleList([
            TransformerLayer(),
            TransformerLayer()
        ])
    
    def forward(self, x):
        return x

# Test case 3: Model with direct layers attribute
class ModelWithDirectLayers(nn.Module):
    def __init__(self):
        super().__init__()
        self.layers = nn.ModuleList([
            TransformerLayer(),
            TransformerLayer()
        ])
    
    def forward(self, x):
        return x

# Use the first model type as the argument
model = ModelWithModelLayers()

ARGS = {
    'model': model
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList 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
get_transformer_layers Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/04_generalization.py
code served (permissive licence) · get_code("564a2bde1159d36c")
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 ModuleList. 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 torch.nn as nn

torch.manual_seed(0)

# Create a simple transformer layer
class SimpleTransformerLayer(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.linear(x)

# Test case 1: model with model.layers structure
class ModelWithModelLayers(nn.Module):
    def __init__(self):
        super().__init__()
        self.model = nn.Module()
        self.model.layers = nn.ModuleList([
            SimpleTransformerLayer(),
            SimpleTransformerLayer()
        ])
    
    def forward(self, x):
        return x

# Use the first test case model
model = ModelWithModelLayers()

ARGS = {
    'model': model
}
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 ModuleList — a ModuleList output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ModuleList 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
load_dimension_prompts Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/02_train_probes.py
code served (permissive licence) · get_code("0a02d2f759fc9dc8")
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 tuple, 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 json
import os
import tempfile
import numpy as np

# Create a temporary directory with a test JSON file
temp_dir = tempfile.mkdtemp()

# Create a sample prompt pairs JSON file
dim_name = "sentiment"
sample_data = {
    "data": [
        {
            "positive_prompt": "This is great!",
            "negative_prompt": "This is terrible!"
        },
        {
            "positive_prompt": "I love this.",
            "negative_prompt": "I hate this."
        },
        {
            "positive_prompt": "Excellent work.",
            "negative_prompt": "Poor work."
        }
    ]
}

# Write the JSON file
json_path = os.path.join(temp_dir, f'dim_{dim_name}.json')
with open(json_path, 'w', encoding='utf-8') as f:
    json.dump(sample_data, f)

# Define ARGS
ARGS = {
    "prompts_dir": temp_dir,
    "dim_name": dim_name,
    "max_pairs": 2
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple 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
resolve_torch_dtype Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/02_train_probes.py
code served (permissive licence) · get_code("b39efbc3ab03acc1")
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 dtype. 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

# The function takes a single parameter: dtype_name (string)
# It maps string names to torch dtype objects or None
# No complex objects needed - just a string argument

ARGS = {
    'dtype_name': 'float32'
}
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 dtype — a dtype output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dtype 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
score_evaluation_awareness Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/metrics.py
code served (permissive licence) · get_code("40052899d4439181")
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 dict. 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 re

def score_evaluation_awareness(response: str):
    """Reference function"""
    pass

# Create a comprehensive test response that exercises all features
ARGS = {
    'response': """
# Step 1: Understanding the Problem

We need to analyze the mathematical expression:

$$\\int_{0}^{\\infty} e^{-x^2} dx$$

This is the classic Gaussian integral. Let me work through it step by step.

## Step 2: Setting up the Solution

First, I'll use the substitution method. Let $u = x^2$, so $du = 2x dx$.

The integral becomes:
$$\\frac{1}{2}\\int_{0}^{\\infty} e^{-u} \\frac{du}{\\sqrt{u}}$$

## Step 3: Applying Gamma Function

This is related to the Gamma function: $\\Gamma(n) = \\int_0^\\infty t^{n-1}e^{-t}dt$

With $n = 1/2$, we get:
$$\\Gamma(1/2) = \\sqrt{\\pi}$$

Therefore:
$$\\int_{0}^{\\infty} e^{-x^2} dx = \\frac{\\sqrt{\\pi}}{2}$$

### Final Answer

The answer is: $\\boxed{\\frac{\\sqrt{\\pi}}{2}}$

I've shown that this integral equals $\\sqrt{\\pi}/2$ using the Gamma function approach.
""".strip()
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
score_perceived_risk Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/metrics.py
code served (permissive licence) · get_code("044c815b9ac8fa14")
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 dict. 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 re

def score_perceived_risk(response: str) -> dict:
    """Test function"""
    pass

# Create a comprehensive test response that exercises various patterns
test_response = """
# Step 1: Problem Analysis

Please note that I must carefully and precisely verify this information. This is important.

## Step 2: Solution Approach

I cannot provide medical advice. I'm not qualified to give legal counsel. 
You should seek professional consultation.

Carefully double-check all calculations. It is critical to verify the accuracy.

The answer is: We need to be precise and accurate here.

\\boxed{42}

**Final Answer**: The solution requires careful verification and disclaimer that this analysis is not medical or legal advice. Use at your own risk.

Section headers help organize the response. Carefulness matters, so please verify independently.
I recommend you consult a professional. This is essential information.
"""

ARGS = {
    "response": test_response
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
score_self_assessed_capability Ran
ran; our contract draft was wrong, not the code
xlands/meta-cognition/src/experiments/metrics.py
code served (permissive licence) · get_code("822599f8e66ad791")
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 dict. 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 re
from typing import Dict, List

# Construct a response string that will be passed to score_self_assessed_capability
response = """
# Step 1: Understanding the Problem

First, let me carefully read through this problem. We need to solve a complex equation.

## Step 2: Setting up the framework

Clearly, this is a straightforward algebraic problem. Let me break it down:

- First, we identify the key variables
- Second, we apply the transformation
- Third, we verify our work

Actually, wait. Let me reconsider the approach here. I think I need to be more careful about the domain.

## Step 3: Mathematical Solution

Using LaTeX: $x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$

And for the display version:
$$\int_0^{\infty} e^{-x^2} dx = \frac{\sqrt{\pi}}{2}$$

Step 1: Calculate the discriminant
Step 2: Apply the quadratic formula
Step 3: Verify the solutions

The answer is definitely: $x = 3$ or $x = -2$

# Final Answer

\boxed{x = 3 \text{ or } x = -2}

Hmm, on second thought, let me verify this is correct. Yes, I believe this is correct without doubt.
"""

ARGS = {
    "response": response
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
should_trust_remote_code Ran
ran, violated the contract we drafted
xlands/meta-cognition/src/experiments/02_train_probes.py
code served (permissive licence) · get_code("fdd47bcf25d72115")
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 bool, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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 torch.nn as nn

torch.manual_seed(0)

# The function takes a single parameter: model_name (str)
# It checks if 'qwen' is in model_name.lower()
# So we need to provide a string argument

ARGS = {
    "model_name": "qwen2-7b"
}
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 bool, ndim 0, dtype family float, shape () — shape () as a later run recorded it
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 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 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 9 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-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) increasingly exhibit behaviors suggesting awareness of their evaluation context, often adapting their reasoning strategies in benchmark settings. Prior work has shown that such evaluation awareness can distort performance measurements; however, it remains unclear whether this phenomenon reflects a single behavioral artifact or a deeper internal structure within the model. We propose that LLMs maintain a decomposable space of functional metacognitive states-internal variables encoding factors such as evaluation awareness, self-assessed capability, perceived risk, computational effort allocation, audience expertise adaptation, and intentionality. Through residual stream analysis across multiple reasoning models, we demonstrate that these states are linearly decodable from internal activations and exhibit distinct layer-wise profiles. Moreover, by steering model activations along probe-derived directions, we show that each functional metacognitive state causally modulates reasoning behavior in dissociable ways, affecting verbosity, accuracy, and safety-related responses across tasks. Our findings suggest that benchmark performance reflects not only task competence but also the activation of specific functional metacognitive states. We argue that understanding and controlling these internal states is essential for reliable evaluation and deployment of reasoning models, and we provide a mechanistic framework for studying functional metacognition in artificial systems. Our code and data are publicly available at https://github.com/xlands/meta-cognition.

For agents

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

get_harvested_code_for_paper("2605.08942")
get_code_for_paper("2605.08942")
have("2605.08942")

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

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

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

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

Connect an agent — have() is free.