PORTS: Preference Optimization for Tool Selection in LLMs

Learn how PORTS improves tool selection in LLMs using preference optimization based on perplexity with low computational cost.

miércoles, 8 de julio de 2026 • 2 min read • Q2BSTUDIO Team

Training retrievers with perplexity signals

The integration of large language models (LLMs) with external tools is becoming one of the most promising architectures for bringing artificial intelligence to complex business scenarios. However, efficiently managing extensive tool catalogs remains a challenge. LLMs, on their own, cannot examine all available options without incurring high latency and token consumption costs. This is where retrievers trained to pre-select the most relevant tools become crucial. Nevertheless, these retrievers are often misaligned with the language models that will use them, as they are optimized with generic loss functions that do not reflect the LLM's actual preference when invoking a tool.

Recent work on PORTS (Odds Ratio Preference Optimization for Tool Selection) proposes a novel approach to align the retriever with the LLM's behavior. Instead of training the retriever with superficial signals, PORTS uses a preference signal inspired by the perplexity of the frozen language model itself. Thus, it optimizes the correlation between a tool's selection probability and its actual performance in downstream tasks, while simultaneously reinforcing a semantic contrast between tool documentation texts. The result is a retriever that not only finds relevant tools but prioritizes those with which the LLM actually works best.

This type of optimization has enormous practical implications for companies that need to deploy intelligent agents capable of interacting with dynamic catalogs of APIs, libraries, or utilities. The ability to generalize to new queries and tools with low computational demand makes PORTS an ideal solution for environments where the tool set is constantly evolving. In this context, artificial intelligence for businesses directly benefits from these advances, as it allows building systems that adapt without the need for costly retraining of each component.

From a technological development perspective, implementing a solution based on PORTS requires a robust infrastructure that combines language models, retrieval services, and flow orchestration. This is where custom software expertise makes a difference. At Q2BSTUDIO, we develop custom applications that integrate language models with enterprise tools, leveraging the cloud to scale. Additionally, we offer AWS and Azure cloud services to deploy these retrievers with low latency, and business intelligence services with Power BI to analyze tool selection performance. Cybersecurity is also critical when exposing tool catalogs to AI agents, so we secure every integration.

The future of LLMs is not just about generating text, but executing actions. The alignment between retrievers and language models, as proposed by PORTS, paves the way for more autonomous and accurate AI agents. If your organization seeks to optimize its workflows with artificial intelligence, having a partner that understands both theory and practice is essential. At Q2BSTUDIO, we combine cutting-edge research with robust development to deliver solutions that truly work in production.

A BREAK?

Play for a moment before you go

OUR SERVICES

How we can help you

Do you have a project in mind?

Tell us your vision and we'll turn it into a software solution. Whatever the scope, we make your idea real.