FormulaEval: Benchmarking Scientific Formula Vocalization in Large Speech Language Models Toward Accessible Learning

March 29, 2026 ยท View on GitHub

๐Ÿค— Datasets ย |ย  ๐Ÿ–ฅ๏ธ Quick Start ย |ย  ยฉ๏ธ Citation


This repository provides the official implementation of FormulaEval, a benchmark for evaluating the ability of Large Speech Language Models (LSLMs) to vocalize scientific formulas โ€” spanning physics, chemistry, and mathematics โ€” toward accessible learning.

Highlights

  • Three curated datasets covering Physics, Chemistry, and Mathematics formula vocalization.
  • Comprehensive evaluation framework supporting multiple state-of-the-art LSLMs out of the box.
  • Flexible evaluation pipeline with support for both local models and API-based judge models.
  • Reproducible benchmarking with configurable metrics including WER and instruction-following evaluation.

Datasets

All datasets are publicly available on HuggingFace ๐Ÿค—:

DatasetDescriptionLink
Physics700Physics formulas and equations๐Ÿค— Physics700
ChemEquationChemical equations and formulas๐Ÿค— ChemEquation
MixMathMixed mathematical expressions๐Ÿค— MixMath

Project Structure

FormulaEval/
โ”œโ”€โ”€ README.md                           # This file
โ”œโ”€โ”€ requirements.txt                    # Python dependencies
โ”œโ”€โ”€ config.yaml                         # Configuration file
โ”œโ”€โ”€ run_audio.py                        # Main evaluation script
โ”œโ”€โ”€ run_audio_online.sh                 # Online evaluation shell script
โ”œโ”€โ”€ almeval/                            # Core evaluation framework
โ”‚   โ”œโ”€โ”€ datasets/                       # Dataset processing modules
โ”‚   โ”‚   โ”œโ”€โ”€ ds_tts.py                   # TTS dataset handler
โ”‚   โ”‚   โ””โ”€โ”€ utils.py                    # Utility functions
โ”‚   โ”œโ”€โ”€ models/                         # Model implementations
โ”‚   โ”‚   โ”œโ”€โ”€ baichuan_audio.py           # Baichuan Audio models
โ”‚   โ”‚   โ”œโ”€โ”€ glm4_voice.py               # GLM-4 Voice model
โ”‚   โ”‚   โ”œโ”€โ”€ kimi_audio.py               # Kimi Audio model
โ”‚   โ”‚   โ”œโ”€โ”€ qwen_omni.py                # Qwen-Omni model
โ”‚   โ”‚   โ””โ”€โ”€ ...                         # Other model implementations
โ”‚   โ”œโ”€โ”€ judge_models/                   # Judge models for evaluation
โ”‚   โ”‚   โ””โ”€โ”€ api/                        # API-based judge models
โ”‚   โ”œโ”€โ”€ metrics/                        # Evaluation metrics
โ”‚   โ”‚   โ”œโ”€โ”€ wer.py                      # Word Error Rate
โ”‚   โ”‚   โ”œโ”€โ”€ cn_tn.py                    # Chinese text normalization
โ”‚   โ”‚   โ””โ”€โ”€ ifeval.py                   # Instruction following evaluation
โ”‚   โ””โ”€โ”€ utils/                          # Utility modules
โ”‚       โ”œโ”€โ”€ config_manager.py           # Configuration management
โ”‚       โ””โ”€โ”€ misc.py                     # Miscellaneous utilities
โ”œโ”€โ”€ data/                               # Dataset storage
โ”‚   โ””โ”€โ”€ downloaded_datasets/            # Local dataset cache
โ”œโ”€โ”€ examples/                           # Example scripts
โ”‚   โ””โ”€โ”€ run_baichuan_eval.sh            # Standalone evaluation script
โ””โ”€โ”€ results/                            # Evaluation results output

Quick Start

1. Environment Setup

# Clone the repository
git clone https://github.com/<your-username>/FormulaEval.git
cd FormulaEval

# Create conda environment
conda create -n formula-eval python=3.11
conda activate formula-eval

# Install dependencies
pip install -r requirements.txt

2. Download Datasets

Datasets are hosted on HuggingFace and can be downloaded automatically or manually:

from datasets import load_dataset

# Load Physics700
physics = load_dataset("Stephen-Lee/FormulaEval_datasets", "Physics700")

# Load ChemEquation
chem = load_dataset("Stephen-Lee/FormulaEval_datasets", "ChemEquation")

# Load MixMath
mixmath = load_dataset("Stephen-Lee/FormulaEval_datasets", "MixMath")

3. Configuration

Important: Before running any evaluation, configure config.yaml with your model paths and API endpoints.

cp config.yaml config_local.yaml

Edit config_local.yaml:

MODEL_PATHS:
  # ASR Models
  asr_zh_model_path: "/path/to/your/paraformer-zh"

  # Audio Language Models
  baichuan_audio_base_path: "/path/to/your/Baichuan-Audio-Base"
  baichuan_audio_instruct_path: "/path/to/your/Baichuan-Audio-Instruct"

API_ENDPOINTS:
  asr_en_service_url: "http://your-whisper-service-url/v1"
  qwen3_api_url: "http://your-qwen3-url/v1/chat/completions"
  openai_api_url: "https://api.openai.com/v1/chat/completions"

API_KEYS:
  openai_api_key: "your-openai-api-key"
# Point to your local config
export PROJECT_CONFIG_PATH="/path/to/your/config_local.yaml"

4. Run Evaluation

bash examples/run_baichuan_eval.sh \
    --model "Baichuan-Audio-Chat" \
    --data "Physics700" \
    --work-dir "./results/my_evaluation"

Option B: Python Script

python run_audio.py \
    --model "Baichuan-Audio-Chat" \
    --data "Physics700" "ChemEquation" "MixMath" \
    --work-dir "./results/baichuan_eval" \
    --eval-method "default"

Debug Mode (Quick Test with 10 Samples)

python run_audio.py \
    --model "Baichuan-Audio-Chat" \
    --data "Physics700" \
    --debug \
    --work-dir "./results/debug_test"

Command Line Reference

run_audio.py

python run_audio.py [OPTIONS]

Required:
  --data DATASET [DATASET ...]   Dataset name(s): Physics700, ChemEquation, MixMath
  --model MODEL                  Model name to evaluate

Optional:
  --work-dir DIR                 Output directory (default: ./eval_result)
  --rank INT                     Current GPU rank (default: 0)
  --world-size INT               Total number of GPUs (default: 1)
  --eval-method METHOD           Evaluation method (default: default)
  --model-path PATH              Custom model path override
  --force-reinfer                Force re-run inference
  --reeval                       Re-evaluate existing predictions only
  --skip-eval                    Skip evaluation, inference only
  --debug                        Debug mode (10 samples per dataset)

Output Structure

work_dir/
โ””โ”€โ”€ ModelName/
    โ”œโ”€โ”€ DatasetName/
    โ”‚   โ”œโ”€โ”€ ModelName_DatasetName.jsonl                         # Raw predictions
    โ”‚   โ”œโ”€โ”€ ModelName_DatasetName_default_performance.json      # Metrics summary
    โ”‚   โ””โ”€โ”€ logs/
    โ”‚       โ””โ”€โ”€ rank0.log                                       # Execution log
    โ””โ”€โ”€ output_audio/                                           # Generated audio (TTS)

Supported Models

ModelTypeNotes
Baichuan-Audio-BaseOpen-sourceRequires local download
Baichuan-Audio-ChatOpen-sourceRequires local download
GLM-4-VoiceOpen-sourceRequires local download
Kimi AudioAPIRequires API key
Qwen-OmniOpen-sourceRequires local download

Troubleshooting

Config file not found

Error: config.yaml not found in project root!

Ensure config.yaml exists and PROJECT_CONFIG_PATH is set correctly.

Model path not accessible

Error: Model path not accessible

Check model paths in config.yaml and ensure models are downloaded.

CUDA out of memory Reduce batch size or use a smaller model. Some models (e.g., StepAudio) require 4ร—80G GPUs.

NLTK data missing The system will automatically download required NLTK data on first run.

Citation

If you find FormulaEval useful in your research, please cite our paper:

@inproceedings{li2026benchmarking,
  title={Benchmarking Scientific Formula Vocalization in Large Speech Language Models Toward Accessible Learning},
  author={Li, Xueyi and Liu, Tianqiao and Zheng, Jiaqi and Liu, Zitao and Wu, Yongdong and Luo, Weiqi},
  booktitle={Proceedings of the 27th International Conference on Artificial Intelligence in Education},
  month={June},
  year={2026},
  address={Seoul, Republic of Korea}
}

Acknowledgements

This codebase is built with reference to the following excellent open-source projects. We sincerely thank the authors for their contributions:

License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.