Autobool
Collection
AutoBool is a reinforcement learning (RL) framework for training large language models (LLMs) to generate high-quality Boolean queries for systema
•
5 items
•
Updated
•
1
This model is part of the AutoBool framework, a reinforcement learning approach for training large language models to generate high-quality Boolean queries for systematic literature reviews.
This variant uses explicit chain-of-thought reasoning. The model is instructed to provide detailed reasoning about the query construction process inside <think></think> tags before generating the final Boolean query.
<think></think>, and the final Boolean query must be enclosed within <answer></answer> tags"<think>[Detailed step-by-step reasoning explaining the query construction process]</think><answer>[Boolean query]</answer>The model was trained using:
This model is designed for:
from transformers import AutoTokenizer, AutoModelForCausalLM
import re
model_name = "ielabgroup/Autobool-Qwen4b-Reasoning"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Define your systematic review topic
topic = "Diagnostic accuracy of endoscopic ultrasonography (EUS) for the preoperative locoregional staging of primary gastric cancer"
# Construct the prompt with system and user messages
messages = [
{"role": "system", "content": "You are an expert systematic review information specialist.\nYou are tasked to formulate a systematic review Boolean query in response to a research topic.\nYour reasoning process should be enclosed within <think></think>, and the final Boolean query must be enclosed within <answer></answer> tags. Do not include anything outside of these tags."},
{"role": "user", "content": f'You are given a systematic review research topic, with the topic title "{topic}".\nYour task is to generate a highly effective Boolean query in MEDLINE format for PubMed.\nThe query should balance **high recall** (capturing all relevant studies) with **reasonable precision** (avoiding irrelevant results):\n- Use both free-text terms and MeSH terms (e.g., chronic pain[tiab], Pain[mh]).\n- **Do not wrap terms or phrases in double quotes**, as this disables automatic term mapping (ATM).\n- Combine synonyms or related terms within a concept using OR.\n- Combine different concepts using AND.\n- Use wildcards (*) to capture word variants (e.g., vaccin* → vaccine, vaccination):\n - Terms must have ≥4 characters before the * (e.g., colo*)\n - Wildcards work with field tags (e.g., breastfeed*[tiab]).\n- Field tags limit the search to specific fields and disable ATM.\n- Do not include date limits.\n- Tag terms using appropriate fields (e.g., covid-19[ti] vaccine[ti] children[ti]) when needed.\n**Only use the following allowed field tags:**\nTitle: [ti], Abstract: [ab], Title/Abstract: [tiab]\nMeSH: [mh], Major MeSH: [majr], Supplementary Concept: [nm]\nText Words: [tw], All Fields: [all]\nPublication Type: [pt], Language: [la]\n\nOutput your full reasoning inside <think></think>.\nOutput the final Boolean query inside <answer></answer>.\nDo not include any content outside these tags.'}
]
# Generate the query
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_length=4096)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
# Extract reasoning and query
reasoning_match = re.search(r'<think>(.*?)</think>', response, re.DOTALL)
query_match = re.search(r'<answer>(.*?)</answer>', response, re.DOTALL)
if reasoning_match and query_match:
reasoning = reasoning_match.group(1).strip()
query = query_match.group(1).strip()
print("Reasoning:", reasoning)
print("\nQuery:", query)
The model will generate output with reasoning:
<think>
[Detailed step-by-step reasoning explaining the query construction process,
including term selection, MeSH terms, field tags, wildcards, and Boolean logic]
</think>
<answer>
[Final Boolean query]
</answer>
If you use this model, please cite:
@inproceedings{autobool2026,
title={AutoBool: Reinforcement Learning for Boolean Query Generation in Systematic Reviews},
author={Shuai Wang, Harrisen Scells, Bevan Koopman, Guido Zuccon},
booktitle={Proceedings of the 2026 Conference of the European Chapter of the Association for Computational Linguistics (EACL)},
year={2026}
}
Apache 2.0