Iterative In-Context Learning to Enhance LLMs Abstract Reasoning: The Case-Study of Algebraic Tasks

Fuente: arXiv
Enregistré dans:
Détails bibliographiques
Auteurs principaux: Fioravanti, Stefano, Zavatteri, Matteo, Confalonieri, Roberto, Zeinalipour, Kamyar, Frazzetto, Paolo, Sperduti, Alessandro, Navarin, Nicolò
Format: Preprint
Publié: 2025
Sujets:
Accès en ligne:
Tags: Ajouter un tag
Pas de tags, Soyez le premier à ajouter un tag!
_version_ 1866915850868490240
author Fioravanti, Stefano
Zavatteri, Matteo
Confalonieri, Roberto
Zeinalipour, Kamyar
Frazzetto, Paolo
Sperduti, Alessandro
Navarin, Nicolò
author_facet Fioravanti, Stefano
Zavatteri, Matteo
Confalonieri, Roberto
Zeinalipour, Kamyar
Frazzetto, Paolo
Sperduti, Alessandro
Navarin, Nicolò
contents LLMs face significant challenges in systematic generalization, particularly when dealing with reasoning tasks requiring compositional rules and handling out-of-distribution examples. To address these challenges, we introduce an in-context learning methodology that improves the generalization capabilities of general purpose LLMs. Our approach employs an iterative example selection strategy, which incrementally constructs a tailored set of few-shot examples optimized to enhance model's performance on a given task. As a proof of concept, we apply this methodology to the resolution of algebraic expressions involving non-standard simplification rules, according to which the priority of addition and multiplication is changed. Our findings indicate that LLMs exhibit limited proficiency in these mathematical tasks. We further demonstrate that LLMs reasoning benefits from our iterative shot selection prompting strategy integrated with explicit reasoning instructions. Crucially, our experiments reveal that some LLMs achieve better generalization performances when prompted with simpler few-shot examples rather than complex ones following the test data distribution.
format Preprint
id arxiv_https___arxiv_org_abs_2509_01267
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle Iterative In-Context Learning to Enhance LLMs Abstract Reasoning: The Case-Study of Algebraic Tasks
Fioravanti, Stefano
Zavatteri, Matteo
Confalonieri, Roberto
Zeinalipour, Kamyar
Frazzetto, Paolo
Sperduti, Alessandro
Navarin, Nicolò
Machine Learning
LLMs face significant challenges in systematic generalization, particularly when dealing with reasoning tasks requiring compositional rules and handling out-of-distribution examples. To address these challenges, we introduce an in-context learning methodology that improves the generalization capabilities of general purpose LLMs. Our approach employs an iterative example selection strategy, which incrementally constructs a tailored set of few-shot examples optimized to enhance model's performance on a given task. As a proof of concept, we apply this methodology to the resolution of algebraic expressions involving non-standard simplification rules, according to which the priority of addition and multiplication is changed. Our findings indicate that LLMs exhibit limited proficiency in these mathematical tasks. We further demonstrate that LLMs reasoning benefits from our iterative shot selection prompting strategy integrated with explicit reasoning instructions. Crucially, our experiments reveal that some LLMs achieve better generalization performances when prompted with simpler few-shot examples rather than complex ones following the test data distribution.
title Iterative In-Context Learning to Enhance LLMs Abstract Reasoning: The Case-Study of Algebraic Tasks
topic Machine Learning
url https://arxiv.org/abs/2509.01267