$A^2Search$: Ambiguity-Aware Question Answering with Reinforcement Learning

October 10, 2025 ยท View on GitHub

๐Ÿ“„ Paper โ€ข ๐Ÿค— Model Weights

Recent advances in Large Language Models (LLMs) and Reinforcement Learning (RL) have greatly improved open-domain Question Answering (QA). However, existing approaches still struggle with ambiguous questions that admit multiple valid answers. Standard QA benchmarksโ€”built under the assumption of a single gold answerโ€”produce misleading training signals and fail to reflect this reality.


We introduce A2SearchA^2Search, an annotation-free, end-to-end training framework that detects and handles ambiguity automatically. Our pipeline works by:

  1. Identifying ambiguous questions
  2. Collecting alternative answers through trajectory sampling and evidence verification
  3. Optimizing with RL using the AnsF1\mathrm{AnsF1} reward, which naturally accommodates multiple valid answers

The figure above shows an ambiguous question from MuSiQue.

  • ReSearch-32B produces different answers across rolloutsโ€”some diverging from the reference but still evidence-supported.
  • A2SearchA^2Search instead resolves ambiguity explicitly by retrieving multiple valid answers within a single rollout.

๐Ÿ”‘ Key Results

The table above reports results on four multi-hop QA benchmarks under the Exact Match metric.

  • We measure AnsF1/Recall@k\mathrm{AnsF1}/\mathrm{Recall}@k with kk rollouts.

  • For A2SearchA^2Search, only @1@1 is shown, since they can produce multiple answers within a single rollout.

  • For other baselines, where each rollout yields only one answer (so AnsF1@1=Recall@1\mathrm{AnsF1}@1=\mathrm{Recall}@1), we additionally include @3@3 results to evaluate performance with more rollouts.

  • The best result in each group is highlighted in bold, and the second best is underlined.

  • On eight open-domain QA benchmarks, A2SearchA^2Search achieves state-of-the-art performance.

  • With only one rollout, A2SearchA^2Search-7B reaches an average AnsF1@1\mathrm{AnsF1}@1 score of 48.4% on four multi-hop benchmarks, outperforming even much larger models like ReSearch-32B (46.2%).

  • Extensive analyses confirm that A2SearchA^2Search not only resolves ambiguity but also generalizes across benchmarks.

๐Ÿ‘‰ Embracing ambiguity is essential for building reliable next-generation QA systems. Please find more experimental results and details in our paper.

๐Ÿš€ Installation

1. Setup Environment

Create and activate a Python virtual environment:

python3 -m venv venv
source venv/bin/activate

Install PyTorch and FlashAttention:

pip3 install torch==2.4.0 --index-url https://download.pytorch.org/whl/cu124
pip3 install flash-attn --no-build-isolation

2. Install Dependencies

Clone this repo and install requirements:

git clone <this-repo-url>
cd <this-repo-name>
pip install -e .

๐Ÿ“š Data

All training and evaluation datasets are available in the ./dataset directory:

  • Training:

    a2search_musique_2wiki_nq.parquet โ€“ constructed using our evidence-verification pipeline.

  • Development:

    musique_random_512_dev.parquet โ€“ used for hyperparameter tuning and checkpoint selection.

  • Evaluation:

    Other benchmark datasets are included for evaluation.

  • Data Structure

    Our datasets are all organized in parquet format and follows the same json structure as below

    {
      "data_source": "", // dataset name
      "question": "", // the target question
      "reward_model": {
        "ground_truth": [
          { "aliases": [], "answer": "" } // reference answers and their aliases
        ],
      },
      "extra_info": {
        "id": "" // question id
      }
    }
    

For retrieval, we reuse the wiki index and retriever from Search-R1. Make sure you have it running locally at:

http://127.0.0.1:80

๐Ÿ‹๏ธ RL Training

We train using the Verl framework. Training code is under the verl/ directory.

Example scripts:

  • Single-node debugging: scripts/train_debug.sh
  • Multi-node training: scripts/train_multinode.sh

โš ๏ธ These scripts provide basic startup commands. For detailed hyperparameter settings, please refer to our paper.


๐Ÿ“Š Evaluation

We provide an evaluation script for running experiments across benchmarks:

cd evaluation
bash run_evaluation.sh

You can configure:

  • Model checkpoint
  • Dataset
  • Temperature
  • Sampling numbers

Before running evaluation, please check:

  • evaluation/config.py โ†’ correct model path
  • evaluation/lmjudge_agent.py โ†’ correct API path and key for the LLM judge module

๐Ÿ“ Citation

If you find this work useful, please cite our paper:

@misc{zhang2025a2searchambiguityawarequestionanswering,
      title={A$^2$Search: Ambiguity-Aware Question Answering with Reinforcement Learning}, 
      author={Fengji Zhang and Xinyao Niu and Chengyang Ying and Guancheng Lin and Zhongkai Hao and Zhou Fan and Chengen Huang and Jacky Keung and Bei Chen and Junyang Lin},
      year={2025},
      eprint={2510.07958},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2510.07958}, 
}