COLING 2025main0 citations

Automatic Mathematic In-Context Example Generation for LLM Using Multi-Modal Consistency

Jaeseong Lee, Wei Yang, Gopal Gupta, Shiyi Wei

Abstract

Large Language Models (LLMs) have advanced Natural Language Processing (NLP) tasks but are limited in mathematical reasoning. To address this, few-shot examples are used in prompts for in-context learning. However, existing methods require annotated datasets, resulting in higher computational costs and lower quality examples. To mitigate these limitations, we propose AutoMathIC, a framework that automatically generates high-quality in-context examples to enhance LLMs’ mathematical reasoning. AutoMathIC ensures consistency across different modalities (e.g., Chain-of-Thought (CoT), code snippets, and equations) by generating and selecting mutations that improve response consistency. Evaluated on four math problem datasets, AutoMathIC outperforms six baselines, with LLM accuracy ranging from 87.0% to 99.3% for GPT-3.5 and 93.1% to 98.7% for GPT-4o-mini. It surpasses the state-of-the-art in-context example retrieval method in three of the four datasets by 0.3% to 11.8%, without relying on an annotated dataset.

BibTeX
@inproceedings{lee-etal-2025-automatic,
    title = "Automatic Mathematic In-Context Example Generation for {LLM} Using Multi-Modal Consistency",
    author = "Lee, Jaeseong  and
      Yang, Wei  and
      Gupta, Gopal  and
      Wei, Shiyi",
    editor = "Rambow, Owen  and
      Wanner, Leo  and
      Apidianaki, Marianna  and
      Al-Khalifa, Hend  and
      Eugenio, Barbara Di  and
      Schockaert, Steven",
    booktitle = "Proceedings of the 31st International Conference on Computational Linguistics",
    month = jan,
    year = "2025",
    address = "Abu Dhabi, UAE",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2025.coling-main.597/",
    pages = "8908--8924"
}
Automatic Mathematic In-Context Example Generation for LLM Using Multi-Modal Consistency · COLING 2025