LitXBench
LitXBench is a benchmark to evaluate LLMs on extracting material information synthesized in research papers. Read the preprint here.
Installation
uv pip install litxbench
Usage
Loading Ground Truth
LitXBench ships with annotated ground-truth extractions. The litxalloy dataset contains 19 papers on alloys.
from litxbench.litxalloy import papers
# papers is a dict mapping DOI strings to list[Experiment]
doi = "doi_10_3390__e21020122"
ground_truth = papers[doi]
Building Extractions
Represent extracted materials as Experiment objects. Each experiment contains raw materials, synthesis groups (with optional template variables), and output materials with their measurements.
from pymatgen.core.composition import Composition
from litxbench import (
CompMeasurement, Configuration, CrysStruct, Experiment, Material,
Measurement, ProcessEvent, ProcessKind, Quantity, RawMaterial, RawMaterialKind,
)
from litxbench.core.models import GlobalLatticeParam
from litxbench.core.units import Celsius, Hour, MegaPascal, Nanometer, gram_per_cm3, percent, HV
from litxbench.litxalloy.models import AlloyMeasurementKind
extracted = [
Experiment(
raw_materials={"elements": RawMaterial(kind=RawMaterialKind.Powder)},
# Synthesis groups can use template variables (e.g. [Duration], [Temp])
# that are substituted per-material via process strings.
synthesis_groups={
"Milling[Duration]": [
ProcessEvent(
kind=ProcessKind.PlanetaryMilling,
duration=Quantity(value="[Duration]", unit=Hour),
),
],
"SPS[Temp]": [
ProcessEvent(
kind=ProcessKind.SparkPlasmaSintering,
temperature=Quantity(value="[Temp]", unit=Celsius),
),
],
},
output_materials=[
# Named materials can be referenced as inputs by later materials
Material(
process="elements->Milling[Duration=60]",
name="base",
measurements=[
CompMeasurement(Composition("CoCrNiCuZn")),
GlobalLatticeParam(
struct=CrysStruct.BCC,
phase_fraction=Quantity(value=100, unit=percent),
),
Measurement(
kind=AlloyMeasurementKind.crystallite_size,
value=13,
unit=Nanometer,
),
Measurement(
kind=AlloyMeasurementKind.lattice_strain,
value=0.7,
unit=percent,
),
# Configurations represent distinct phases within a material
Configuration(
name="Phase 1",
measurements=[
Measurement(kind=AlloyMeasurementKind.solidus, value=1244.8, unit=Celsius),
],
),
],
),
# This material chains from "base" through the SPS synthesis group
Material(
process="base->SPS[Temp=900]",
measurements=[
CompMeasurement(Composition("CoCrNiCuZn")),
Measurement(kind=AlloyMeasurementKind.density, value=7.89, unit=gram_per_cm3),
Measurement(kind=AlloyMeasurementKind.ultimate_compressive_strength, value=2121, unit=MegaPascal),
Measurement(kind=AlloyMeasurementKind.vickers_hardness, value=615, unit=HV),
GlobalLatticeParam(struct=CrysStruct.FCC, name="FCC1"),
GlobalLatticeParam(struct=CrysStruct.FCC, name="FCC2"),
],
),
],
),
]
Evaluating Extractions
Compare your extractions against the ground truth to get precision, recall, and F1 scores.
from litxbench import compare_experiments
result = compare_experiments(ground_truth, extracted)
print(f"Precision: {result.precision:.2%}")
print(f"Recall: {result.recall:.2%}")
print(f"F1: {result.f1:.2%}")
For multi-level metrics (value, process, configuration, and material levels):
from litxbench.core.eval import compute_multi_level_metrics
metrics = compute_multi_level_metrics(result)
print(f"Overall F1: {metrics.overall_f1:.2%}")
print(f"Value F1: {metrics.value_f1:.2%}")
print(f"Process F1: {metrics.process_f1:.2%}")
A complete end-to-end example is available at examples/usage.py.
Paper Evaluation Scripts Warning
For the evaluation scripts used in the paper, LitXBench instructs LLMs to format the extracted materials as code. This code is run by LitXBench via Python exec. Do NOT call untrusted LLMs as they may generate untrusted code which could be executed on your machine.
Citation
If you use LitXBench in your research, please cite:
@article{chong2026litxbench,
title = {LitXBench: A Benchmark for Extracting Experiments from Scientific Literature},
author = {Curtis Chong and Jorge Colindres},
year = {2026},
eprint = {2604.07649},
archivePrefix = {arXiv},
primaryClass = {cs.IR},
url = {https://arxiv.org/abs/2604.07649}
}
Metadata
Release files for litxbench 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| litxbench-0.1.3.tar.gz | 14.7 MB | Without provenance | Details for litxbench-0.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| litxbench-0.1.3-py3-none-any.whl | Python 3 | none | any | Details for litxbench-0.1.3-py3-none-any.whl |
Total release size: 29.6 MB
Release files / litxbench-0.1.3.tar.gz
| Download URL | litxbench-0.1.3.tar.gz |
|---|---|
| Size | 14.7 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce30aee604c23b57a3905183619101f0be8829a57e92cbb5df69d3fb420be4ed
|
|
BLAKE2b-256 checksum How to use checksums |
677cd7b3238e8e37fcdf1d17957a935dcf58f0d4deb2e1963ab695571ce10634
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Release files / litxbench-0.1.3-py3-none-any.whl
| Download URL | litxbench-0.1.3-py3-none-any.whl |
|---|---|
| Size | 14.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
068a9c034dece37ed0b81dff78cf04f0a402ab902bb572215f5bf004305e73e3
|
|
BLAKE2b-256 checksum How to use checksums |
9aefd9cc2cfe6c486e4e76128b13de81a0264cb9fc74769ecac6dee3adb222dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.9
|
Security for litxbench 0.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.