SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2608.31058 · 2026

Improving Information Extraction with Learned Queries

Soroush Vosoughi, Nikhil Singh, Omar Sharif

arXiv · PDF · Open in the Atlas

Code that ran

6 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, 0 violated it and 0 have no contract verdict; 6 failures of our instrument; 3 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/2608.31058.json · badge: /api/ran/2608.31058.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
ZhaoyueSun/PHEE canonical (classifier label)
classifier basis: census
6 ran · 3 no recorded run
FunctionStatusWhere it lives
get_entities Ran
ran; our contract draft was wrong, not the code
ZhaoyueSun/PHEE/evaluate/compute_iaa.py
code served (permissive licence) · get_code("1c86299e72aa56cf")
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

torch.manual_seed(0)

# Construct valid arguments for get_entities(texts)
# The function expects 'texts' which is iterated as:
#   for spans in texts:
#       for span in spans:
#           output.append(span)
# So texts should be a list of lists (or iterable of iterables)

texts = [
    ["entity1", "entity2"],
    ["entity3", "entity4", "entity5"]
]

ARGS = {
    "texts": texts
}
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 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_event_entities Ran
ran; our contract draft was wrong, not the code
ZhaoyueSun/PHEE/evaluate/compute_iaa.py
code served (permissive licence) · get_code("9949aa6128bf92a9")
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 defaultdict. 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.

from collections import defaultdict

# Construct valid arguments for get_event_entities
ARGS = {
    'events': [
        {
            'event_type': 'Medication',
            'Trigger': {
                'text': [
                    ['took', 'aspirin']
                ]
            },
            'Subject': {
                'text': [
                    ['patient', 'age', '45']
                ],
                'Age': {
                    'text': [
                        ['45', 'years']
                    ]
                },
                'Gender': {
                    'text': [
                        ['male']
                    ]
                },
                'Population': {
                    'text': [
                        ['adults']
                    ]
                }
            },
            'Treatment': {
                'text': [
                    ['aspirin', '100mg']
                ],
                'Drug': {
                    'text': [
                        ['aspirin']
                    ]
                },
                'Dosage': {
                    'text': [
                        ['100mg']
                    ]
                },
                'Freq': {
                    'text': [
                        ['daily']
                    ]
                },
                'Route': {
                    'text': [
                        ['oral']
                    ]
                },
                'Combination': [
                    {
                        'Trigger': {
                            'text': [
                                ['combined', 'with']
                            ]
                        },
                        'Drug': {
                            'text': [
                                ['ibuprofen']
                            ]
                        }
                    }
                ]
            },
            'Effect': {
                'text': [
                    ['pain', 'relief']
                ]
            },
            'Speculation': {
                'text': [
                    ['possibly']
                ]
            },
            'Negation': {
                'text': [
                    ['no']
                ]
            },
            'Severity': {
                'text': [
                    ['mild']
                ]
            }
        },
        {
            'event_type': 'Adverse',
            'Trigger': {
                'text': [
                    ['developed', 'rash']
                ]
            },
            'Subject': {
                'text': [
                    ['patient']
                ],
                'Race': {
                    'text': [
                        ['Caucasian']
                    ]
                },
                'Disorder': {
                    'text': [
                        ['asthma']
                    ]
                }
            },
            'Treatment': {
                'text': [
                    ['penicillin']
                ],
                'Drug': {
                    'text': [
                        ['penicillin']
                    ]
                },
                'Time_elapsed': {
                    'text': [
                        ['2', 'hours']
                    ]
                },
                'Duration': {
                    'text': [
                        ['3', 'days']
                    ]
                }
            },
            'Effect': {
                'text': [
                    ['allergic', 'reaction']
                ]
            }
        }
    ]
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
parse_entities Ran
ran; our contract draft was wrong, not the code
ZhaoyueSun/PHEE/gen_qa/transfer_s1_pred_to_s2_input.py
code served (permissive licence) · get_code("3752897e8ab09170")
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 re
from collections import defaultdict

def parse_entities(text):
    EVENT_TYPES = ['Adverse event', 'Potential therapeutic event']
    MAIN_ARGS = ['Subject', 'Treatment', 'Effect']
    pattern = re.compile('\\[.*?\\][^\\[]*')
    entities = defaultdict(list)
    events = []
    event = None
    for ent_str in re.findall(pattern, text):
        k, v = ent_str.split(']', 1)
        k = k.replace('[', '').strip()
        v = v.strip()
        if k in EVENT_TYPES:
            if event is not None:
                events.append(event)
            event = {'type': '_'.join(k.split(' ')), 'Trigger': v}
        elif event and k in MAIN_ARGS:
            if k not in event:
                event[k] = []
            if v:
                spans = v.split(';')
            for span in spans:
                event[k].append(span.strip())
        else:
            continue
    if event is not None:
        events.append(event)
    return events

# Setup code to construct valid arguments
text_input = (
    "[Adverse event] patient fever; [Subject] John Doe; [Treatment] aspirin; "
    "[Effect] fever reduced; [Potential therapeutic event] recovery started; "
    "[Subject] patient; [Effect] improved"
)

ARGS = {
    'text': text_input
}
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
read_gold_result Ran
ran; our contract draft was wrong, not the code
ZhaoyueSun/PHEE/gen_qa/eval_stage2_preds.py
code served (permissive licence) · get_code("1b1ea83bf6d6e62b")
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 defaultdict. 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
from collections import defaultdict
import tempfile
import os

# Create a temporary JSON file with the expected structure
gold_data = {
    "data": [
        {
            "id": "q1_0",
            "question_type": "entity",
            "answers": "apple; banana"
        },
        {
            "id": "q1_1",
            "question_type": "entity",
            "answers": "orange"
        },
        {
            "id": "q2_0",
            "question_type": "relation",
            "answers": "located_in; part_of"
        },
        {
            "id": "q2_1",
            "question_type": "relation",
            "answers": ""
        }
    ]
}

# Write to a temporary file
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.json', delete=False)
json.dump(gold_data, temp_file)
temp_file.close()

ARGS = {
    "gold_file": temp_file.name
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
read_pred_result Ran
ran; our contract draft was wrong, not the code
ZhaoyueSun/PHEE/gen_qa/eval_stage2_preds.py
code served (permissive licence) · get_code("6b64da5807e312fb")
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 defaultdict. 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 tempfile
import os
from collections import defaultdict

# Create a temporary JSON file with the expected structure
temp_dir = tempfile.mkdtemp()
pred_file = os.path.join(temp_dir, "predictions.json")

pred_data = {
    "label_ids": [
        {"id": "example_1_0", "question_type": "entity"},
        {"id": "example_1_1", "question_type": "relation"},
        {"id": "example_2_0", "question_type": "entity"},
    ],
    "predictions": [
        {"id": "example_1_0", "prediction_text": "apple; banana"},
        {"id": "example_1_1", "prediction_text": "subject; object"},
        {"id": "example_2_0", "prediction_text": "orange"},
    ]
}

with open(pred_file, 'w') as f:
    json.dump(pred_data, f)

ARGS = {
    "pred_file": pred_file
}
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 defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
read_pred_result Ran
ran; our contract draft was wrong, not the code
ZhaoyueSun/PHEE/gen_qa/transfer_s1_pred_to_s2_input.py
code served (permissive licence) · get_code("2087e9b976cfcfd8")
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 tempfile
import os

# Create a temporary JSON file with prediction results
temp_dir = tempfile.mkdtemp()
pred_file = os.path.join(temp_dir, "predictions.json")

# Create sample prediction data matching the expected format
pred_data = {
    "predictions": [
        {
            "id": "sample_1_0",
            "prediction_text": "[Adverse event]fever[Subject]patient A[Treatment]medication X[Effect]high temperature"
        },
        {
            "id": "sample_1_1",
            "prediction_text": "[Potential therapeutic event]recovery[Subject]patient B[Treatment]therapy Y[Effect]improved condition"
        },
        {
            "id": "sample_2_0",
            "prediction_text": "[Adverse event]headache[Subject]patient C[Treatment]drug Z[Effect]mild pain"
        }
    ]
}

# Write the prediction file
with open(pred_file, 'w') as f:
    json.dump(pred_data, f)

ARGS = {
    "pred_file": pred_file
}
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
compute_metric Not yet run
unverified (harvested, no recorded run)
ZhaoyueSun/PHEE/evaluate/phee_metric.py
code served (permissive licence) · get_code("65ffc8abe1a9b4eb")
How it ran

no invocation recorded.

postprocess_qa_predictions Not yet run
unverified (harvested, no recorded run)
ZhaoyueSun/PHEE/gen_qa/utils_qa.py
code served (permissive licence) · get_code("91d01d763bcc6469")
How it ran

no invocation recorded.

postprocess_qa_predictions_with_beam_search Not yet run
unverified (harvested, no recorded run)
ZhaoyueSun/PHEE/gen_qa/utils_qa.py
code served (permissive licence) · get_code("b6b83db7ad282791")
How it ran

no invocation recorded.

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

When information extraction fails, a natural instinct is to improve the model doing it: for example, by scaling it up or refining its reasoning. In this paper, we show that another part of the pipeline matters at least as much: the queries used to elicit this information. Across four clinical benchmarks and five LLMs, improving the question design alone raises performance by 18.6 F1-score points, i.e. more than using larger extraction models. To make such question design learnable, we introduce List of Questions (LoQ), which generates document-specific question sets, and FeedQ, a feedback-driven optimization method that iteratively refines questions against extraction outcomes. The resulting optimized questions can be used to train lightweight generators: with fine-tuning, 4B-parameter models match or outperform expert-derived baselines and substantially exceed the performance of much larger untuned models. We release a dataset of 12,820 optimized questions to support a broader shift in information extraction research toward treating question design as a first-class problem.

For agents

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

get_harvested_code_for_paper("2608.31058")
get_code_for_paper("2608.31058")
have("2608.31058")

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

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

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

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

Connect an agent — have() is free.