SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.15962 · 2026

SEER: Long-Context Reasoning via Selective Visual-Text Compression

Tianlong Chen, Yi Zhang, Guanchu Wang, Ying Ding, Jiawei Xu, Jinrui Fang, Zhilin Zhai, Ruohan Xu, Mingfei Lu

arXiv · PDF

Code that ran

9 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 9 failures of our instrument; 3 no recorded run), measured 2026-11-24; 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/2608.15962.json · badge: /api/ran/2608.15962.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
jiaweixu98/SEER community
Papers with Code archive
9 ran · 3 no recorded run
FunctionStatusWhere it lives
_extract_completion_meta Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("3ee23299db36451e")
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 torch

torch.manual_seed(0)

# The function _extract_completion_meta expects a result dict
# It accesses: 'choices', 'id', 'model', 'usage'
# Within choices[0]: 'message', 'finish_reason', 'stop_reason'
# Within message: 'stop_reason'
# Within usage: 'prompt_tokens', 'completion_tokens', 'total_tokens'

result = {
    'id': 'chatcmpl-123abc',
    'model': 'gpt-4',
    'choices': [
        {
            'message': {
                'content': 'This is a completion.',
                'stop_reason': 'length'
            },
            'finish_reason': 'stop',
            'stop_reason': None
        }
    ],
    'usage': {
        'prompt_tokens': 10,
        'completion_tokens': 15,
        'total_tokens': 25
    }
}

ARGS = {
    'result': result
}
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 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
_extract_message_content Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("f3b1fe4f57ef9eaf")
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.

import torch
import numpy as np
from typing import Any, Dict, List, Optional, Union

torch.manual_seed(0)

# The function _extract_message_content expects a Dict[str, Any] parameter named 'result'
# It accesses: result.get('choices', [{}])[0].get('message', {}).get('content', '')
# So we need to construct a valid dict with the structure of an API response

result = {
    'choices': [
        {
            'message': {
                'content': 'This is the extracted message content'
            }
        }
    ]
}

ARGS = {
    'result': result
}
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 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
build_user_content_interleaved Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("063ded2ca656e82a")
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 os
import tempfile
from PIL import Image

# Create temporary directory for test images
temp_dir = tempfile.mkdtemp()

# Create a simple test image
def create_test_image(filepath, width=200, height=150):
    img = Image.new('RGB', (width, height), color=(73, 109, 137))
    img.save(filepath)
    return filepath

# Create test images
image_path_1 = create_test_image(os.path.join(temp_dir, 'test_image_1.png'), 200, 150)
image_path_2 = create_test_image(os.path.join(temp_dir, 'test_image_2.png'), 300, 200)

ARGS = {
    'image_paths': [image_path_1, image_path_2],
    'prompt_text': 'What is shown in these images?',
    'max_pixels': 100000
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — 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
encode_image_with_max_pixels Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("442a047f1a40e78f")
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.

import os
import base64
import io
import math
from PIL import Image
import tempfile

# Create a temporary image file for testing
with tempfile.NamedTemporaryFile(suffix='.png', delete=False) as tmp:
    # Create a simple test image
    img = Image.new('RGB', (200, 150), color='red')
    img.save(tmp.name)
    temp_image_path = tmp.name

ARGS = {
    'image_path': temp_image_path,
    'max_pixels': 100000,
    'save_compressed': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — 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
execute_locate_tool Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("0796a80b864c259c")
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.

import torch
import numpy as np

torch.manual_seed(0)

# Analyze function usage:
# - indices: List[int] - used to iterate and check bounds against len(page_texts)
# - page_texts: List[str] - used with len() and indexed with idx-1

# Create valid arguments
indices = [1, 2, 5, 3]  # Mix of valid and out-of-range indices
page_texts = [
    "This is text from page 1",
    "This is text from page 2", 
    "This is text from page 3"
]

ARGS = {
    "indices": indices,
    "page_texts": page_texts
}
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 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
extract_final_answer Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("bddb0535ff92827e")
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.

import re

def extract_final_answer(text: str) -> str:
    if not text:
        return ''
    normalized = text.replace('\r\n', '\n').replace('\r', '\n')
    think_end = re.search('</think>', normalized, re.IGNORECASE)
    tail = normalized[think_end.end():] if think_end else normalized
    stop_markers = ['<|user|>', '<tool_call>', '<|observation|>']
    cut = len(tail)
    for marker in stop_markers:
        idx = tail.find(marker)
        if idx != -1 and idx < cut:
            cut = idx
    candidate = tail[:cut].strip()
    if candidate:
        return candidate
    for line in reversed(text.splitlines()):
        line = line.strip()
        if line and (not line.startswith('<')):
            return line
    return ''

# Test case 1: text with think tags and final answer
text1 = "<think>Some reasoning here</think>\nFinal Answer: 42"

# Test case 2: text with stop markers
text2 = "<think>reasoning</think>\nThe answer is yes<|user|>next message"

# Test case 3: empty text
text3 = ""

# Test case 4: text with multiple lines, no special markers
text4 = "Line 1\nLine 2\nLine 3"

# Test case 5: text with carriage returns
text5 = "Start\r\nMiddle\r\nEnd"

ARGS = {
    "text": text1
}
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
load_page_texts_for_sample Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("280380d6785b7778")
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. 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 os
import json
import tempfile
from typing import List

# Create a temporary directory with necessary files
temp_dir = tempfile.mkdtemp()

# Create a sample page_texts.json file
page_texts_data = ["Page 1 text", "Page 2 text", "Page 3 text"]
page_texts_path = os.path.join(temp_dir, 'page_texts.json')
with open(page_texts_path, 'w', encoding='utf-8') as f:
    json.dump(page_texts_data, f)

# Create a dummy image path that points to the temp directory
image_path_1 = os.path.join(temp_dir, 'image1.png')
image_path_2 = os.path.join(temp_dir, 'image2.png')

# Touch the image files (create empty files)
open(image_path_1, 'a').close()
open(image_path_2, 'a').close()

ARGS = {
    'image_paths': [image_path_1, image_path_2],
    'sample_id': 'test_sample_001'
}
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 tuple — a tuple 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
parse_tool_call Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("290fa4d34658fc5e")
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 json
import re
from typing import Any, Dict, List, Optional, Union

# The function parse_tool_call takes a single parameter: text (str)
# It searches for tool_call XML blocks and extracts name and arguments

# Create test inputs that exercise the function
text_with_tool_call = """
Some text before
<tool_call>
my_function_name
<arg_key>param1</arg_key>
<arg_value>42</arg_value>
<arg_key>param2</arg_key>
<arg_value>"hello"</arg_value>
<arg_key>param3</arg_key>
<arg_value>[1, 2, 3]</arg_value>
</tool_call>
Some text after
"""

ARGS = {
    'text': text_with_tool_call
}
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
truncate_observation Ran
ran; our contract draft was wrong, not the code
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("56221c8ae1bd05c7")
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.

import torch

ARGS = {
    "observation": "Text from image this is a very long line that should be truncated when it exceeds the maximum character limit\nAnother line\nText from image short",
    "max_chars_per_page": 50
}
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 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
_apply_max_tokens Not yet run
unverified (harvested, no recorded run)
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("2753397fa4285068")
How it ran

no invocation recorded.

_call_chat_completion Not yet run
unverified (harvested, no recorded run)
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("1e5c4658466172b3")
How it ran

no invocation recorded.

post_api Not yet run
unverified (harvested, no recorded run)
jiaweixu98/SEER/seer/infer/api_base.py
code served (permissive licence) · get_code("89bfd7de8dad3408")
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, 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 12 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-24.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Long-context reasoning remains computationally expensive for large language models due to the quadratic complexity of attention over text tokens. Visual-text compression offers a promising alternative by rendering text into images and processing them with vision-language models, often reducing token usage. However, existing approaches apply uniform compression regardless of query relevance, potentially sacrificing precision where detailed extraction is required. We present SEER, a framework that learns to select query-relevant images through visual scanning and retrieve textual content only where needed, combining the efficiency of visual compression with the precision of text-based reasoning. Through supervised fine-tuning on tool-interaction trajectories, SEER learns adaptive tool invocation for selection and retrieval. Experiments on long-context benchmarks show that SEER improves extraction precision through selective text retrieval while retaining average prompt-token savings relative to full-text baselines. On LongBench, SEER achieves 51.11% average accuracy, outperforming the visual-text baseline Glyph-9B by 2.33 points and Qwen3-8B by 3.49 points. Code can be accessed at https://github.com/jiaweixu98/SEER.

For agents

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

get_harvested_code_for_paper("2608.15962")
get_code_for_paper("2608.15962")
have("2608.15962")

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

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

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

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

Connect an agent — have() is free.