SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.31054 · 2026

ADAPT: Attention Dynamics Alignment with Preference Tuning for Faithful MLLMs

Zhendong Mao, Jiajun Li, Zheren Fu, Yi Tu, Zhiyuan Yao, Zhixiao Zheng

arXiv · PDF

Code that ran

3 of 5 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (3 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 0 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/2606.31054.json · badge: /api/ran/2606.31054.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
yao-ustc/ADAPT community
Papers with Code archive
3 ran · 2 no recorded run
FunctionStatusWhere it lives
ADAPTConfig Ran
ran on a synthesized input · constructed an object; no result was computed
yao-ustc/ADAPT/adapt/hook_logger.py
code served (permissive licence) · get_code("95d4e7df39e9b559")
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, ADAPTConfig: 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
import torch.nn as nn
from dataclasses import dataclass, field
from typing import Dict, List, Optional

torch.manual_seed(0)

@dataclass
class ADAPTConfig:
    """Central configuration for ADAPT attention-based hallucination mitigation."""
    IMAGE_PATCH_DIM: int = 24
    TOTAL_ATTENTION_LAYERS: int = 32
    ATTENTION_SLICE_START: int = 35
    ATTENTION_SLICE_END: int = 611
    NUM_IMAGE_TOKENS: int = 576
    ANCHOR_NUM_TOKENS: int = 5
    WEIGHT_BOUNDARY_PENALTY: float = 0.25
    WEIGHT_FREQUENCY_MATCH: float = 0.3
    WEIGHT_SMOOTHNESS: float = 0.15
    WEIGHT_CONCENTRATION: float = 0.2
    WEIGHT_LAYER_POSITION: float = 0.1
    OMEGA_SPEC: float = 0.4
    OMEGA_SMOOTH: float = 0.3
    OMEGA_FOCUS: float = 0.3
    BOUNDARY_PATCH_THICKNESS: int = 2
    BOUNDARY_PENALTY_THRESHOLD_RATIO: float = 0.6
    BOUNDARY_PENALTY_STRENGTH: float = 2.0
    FFT_RADIAL_CUTOFF_RATIO: float = 0.25
    FREQ_MATCH_SCALING_FACTOR: float = 10.0
    DEFAULT_ENHANCE_COE: float = 10.0
    DEFAULT_KERNEL_SIZE: int = 3
    EDGE_HALVING_FACTOR: float = 0.5
    POINT_SMOOTHING_KERNEL_SIZE: int = 5
    HEATMAP_THRESHOLD_PERCENTILE: float = 0.4
    AMC_THRESHOLD_TAU: float = 0.6
    STEERING_STRENGTH_ALPHA: float = 0.5
    HHI_INITIAL_PHASE_CALLS: int = 5
    HHI_ADAPTIVE_K1: float = 0.4
    DEFAULT_LAYER_INDICES: List[int] = field(default_factory=lambda: list(range(32)))
    DPO_BETA: float = 0.1

ARGS = {
    "IMAGE_PATCH_DIM": 24,
    "TOTAL_ATTENTION_LAYERS": 32,
    "ATTENTION_SLICE_START": 35,
    "ATTENTION_SLICE_END": 611,
    "NUM_IMAGE_TOKENS": 576,
    "ANCHOR_NUM_TOKENS": 5,
    "WEIGHT_BOUNDARY_PENALTY": 0.25,
    "WEIGHT_FREQUENCY_MATCH": 0.3,
    "WEIGHT_SMOOTHNESS": 0.15,
    "WEIGHT_CONCENTRATION": 0.2,
    "WEIGHT_LAYER_POSITION": 0.1,
    "OMEGA_SPEC": 0.4,
    "OMEGA_SMOOTH": 0.3,
    "OMEGA_FOCUS": 0.3,
    "BOUNDARY_PATCH_THICKNESS": 2,
    "BOUNDARY_PENALTY_THRESHOLD_RATIO": 0.6,
    "BOUNDARY_PENALTY_STRENGTH": 2.0,
    "FFT_RADIAL_CUTOFF_RATIO": 0.25,
    "FREQ_MATCH_SCALING_FACTOR": 10.0,
    "DEFAULT_ENHANCE_COE": 10.0,
    "DEFAULT_KERNEL_SIZE": 3,
    "EDGE_HALVING_FACTOR": 0.5,
    "POINT_SMOOTHING_KERNEL_SIZE": 5,
    "HEATMAP_THRESHOLD_PERCENTILE": 0.4,
    "AMC_THRESHOLD_TAU": 0.6,
    "STEERING_STRENGTH_ALPHA": 0.5,
    "HHI_INITIAL_PHASE_CALLS": 5,
    "HHI_ADAPTIVE_K1": 0.4,
    "DEFAULT_LAYER_INDICES": list(range(32)),
    "DPO_BETA": 0.1,
}
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 ADAPTConfig — 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 ADAPTConfig 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
HookManager Ran
ran on a synthesized input · constructed an object; no result was computed
yao-ustc/ADAPT/adapt/hook_logger.py
code served (permissive licence) · get_code("7b16d77f8880e11d")
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, HookManager: 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
import torch.nn as nn
from collections import defaultdict
from typing import Dict, List, Callable

torch.manual_seed(0)

# Create simple hook functions
def hook_fn_1(ret):
    """Simple hook that returns the input unchanged"""
    return ret

def hook_fn_2(ret):
    """Another simple hook that modifies the input slightly"""
    if isinstance(ret, torch.Tensor):
        return ret + 1
    return ret

def hook_fn_3(ret):
    """Third hook function"""
    return ret

# Create initial hook_dict with some hooks registered
initial_hook_dict = defaultdict(list)
initial_hook_dict['after_softmax'] = [hook_fn_1, hook_fn_2]
initial_hook_dict['before_linear'] = [hook_fn_3]

ARGS = {
    'hook_dict': initial_hook_dict
}
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 HookManager — 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 HookManager 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
MaskHookLogger Ran
ran on a synthesized input · constructed an object; no result was computed
yao-ustc/ADAPT/adapt/hook_logger.py
code served (permissive licence) · get_code("e571350f04423491")
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, MaskHookLogger: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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
from dataclasses import dataclass, field
from typing import Dict, List, Optional

torch.manual_seed(0)

@dataclass
class ADAPTConfig:
    """Central configuration for ADAPT attention-based hallucination mitigation."""
    IMAGE_PATCH_DIM: int = 24
    TOTAL_ATTENTION_LAYERS: int = 32
    ATTENTION_SLICE_START: int = 35
    ATTENTION_SLICE_END: int = 611
    NUM_IMAGE_TOKENS: int = 576
    ANCHOR_NUM_TOKENS: int = 5
    WEIGHT_BOUNDARY_PENALTY: float = 0.25
    WEIGHT_FREQUENCY_MATCH: float = 0.3
    WEIGHT_SMOOTHNESS: float = 0.15
    WEIGHT_CONCENTRATION: float = 0.2
    WEIGHT_LAYER_POSITION: float = 0.1
    OMEGA_SPEC: float = 0.4
    OMEGA_SMOOTH: float = 0.3
    OMEGA_FOCUS: float = 0.3
    BOUNDARY_PATCH_THICKNESS: int = 2
    BOUNDARY_PENALTY_THRESHOLD_RATIO: float = 0.6
    BOUNDARY_PENALTY_STRENGTH: float = 2.0
    FFT_RADIAL_CUTOFF_RATIO: float = 0.25
    FREQ_MATCH_SCALING_FACTOR: float = 10.0
    DEFAULT_ENHANCE_COE: float = 10.0
    DEFAULT_KERNEL_SIZE: int = 3
    EDGE_HALVING_FACTOR: float = 0.5
    POINT_SMOOTHING_KERNEL_SIZE: int = 5
    HEATMAP_THRESHOLD_PERCENTILE: float = 0.4
    AMC_THRESHOLD_TAU: float = 0.6
    STEERING_STRENGTH_ALPHA: float = 0.5
    HHI_INITIAL_PHASE_CALLS: int = 5
    HHI_ADAPTIVE_K1: float = 0.4
    DEFAULT_LAYER_INDICES: List[int] = field(default_factory=lambda: list(range(32)))
    DPO_BETA: float = 0.1

default_config = ADAPTConfig()

class DummyModel(nn.Module):
    """Minimal model with required attributes for MaskHookLogger."""
    def __init__(self):
        super().__init__()
        self.config = type('obj', (object,), {
            'torch_dtype': torch.float32
        })()
        self.dummy_layer = nn.Linear(4, 4)
    
    def forward(self, x):
        return self.dummy_layer(x)

device = torch.device('cpu')
model = DummyModel()

ARGS = {
    'model': model,
    'device': device,
    'layer_idx': 5,
    'mode': 'hhi',
    'initial_phase_calls': 3,
    'adaptive_k1': 0.5,
    'cfg': default_config,
}
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 MaskHookLogger — 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 MaskHookLogger 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
hook_logger_multi Not yet run
unverified (harvested, no recorded run)
yao-ustc/ADAPT/adapt/hook_logger.py
code served (permissive licence) · get_code("b872d0bfda5d660c")
How it ran

no invocation recorded.

init_hookmanager Not yet run
unverified (harvested, no recorded run)
yao-ustc/ADAPT/adapt/hook_logger.py
code served (permissive licence) · get_code("6ffe69e12fa39b93")
How it ran

no invocation recorded.

Also present in other papers' code

Of 5 samples lifted from this paper's linked repositories, 5 carry a function identity and 0 do not. Of the 5 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 5 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

Multimodal Large Language Models (MLLMs) are critically hampered by hallucination-generating content inconsistent with the provided image. In this paper, we identify an internal signature of hallucination: progressive degradation of text-to-image cross-attention during generation, leading to specific failure patterns like unfocused or biased attention. Existing mitigation strategies are largely outcome-driven and do not explicitly target this failure mode. To address this problem, we propose ADAPT (Attention Dynamics Alignment with Preference Tuning), an attention-based framework that intervenes directly on text-toimage cross-attention dynamics. We propose ADAPT with three key contributions: a cross-attention visual anchor refined from early decoding to provide stable spatial grounding, an attention-supervised inference mechanism that detects and corrects attention drift online, and a Visual Attention Guidance DPO that aligns preferences toward visually grounded responses. Experiments show that each component of ADAPT contributes to hallucination reduction, and the full framework achieves new best results across multiple hallucination benchmarks, reducing hallucination rates by 40-60% across mainstream backbones while preserving general multimodal capabilities. Our work provides an attentionbased perspective on mitigating hallucinations by exploring the model's internal text-to-image cross-attention behaviors. Code is available at: https://github.com/yao-ustc/ADAPT.

For agents

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

get_harvested_code_for_paper("2606.31054")
get_code_for_paper("2606.31054")
have("2606.31054")

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

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

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

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

Connect an agent — have() is free.