TL;DR
EVOREC is a new evolution-aware framework that solves the problem of recommending software services and APIs in rapidly changing ecosystems without the massive computational cost of retraining Large Language Models (LLMs). By combining localized model editing (to surgically update service facts) with trie-guided Finite Automata constrained decoding (to prevent hallucinations), EVOREC delivers highly accurate, valid, and up-to-date API recommendations.
What Problem Does This Paper Address?
Modern software development relies heavily on web services and APIs. However, the service ecosystem is inherently dynamic: APIs are constantly updated, deprecated, split, or replaced, and new services are introduced daily.
While Large Language Models (LLMs) excel at understanding user requirements and generating API pipelines, they suffer from three major flaws in production environments:
- Knowledge Staleness: LLMs are frozen in time based on their static training data, meaning they don't natively know when an API's interface changes.
- Hallucinations: They frequently generate syntactically plausible but non-existent or outdated service names.
- High Maintenance Costs: Frequently retraining or fine-tuning a massive model to keep up with daily API updates is computationally prohibitive.
The authors tackle this gap by finding a way to update an LLM's internal knowledge base efficiently and ensure its outputs strictly conform to real-world, currently available APIs.
Methods
The authors introduce EVOREC (Evolution-Aware Framework for Service Recommendation), which relies on a locate-then-edit paradigm and structured decoding:
- Model Editing Module (ROME): Instead of fine-tuning the entire model, EVOREC uses Rank-One Model Editing (ROME). It locates the specific feed-forward network (FFN) layers responsible for storing a service fact and applies a lightweight, mathematical update to the weight matrix. This injects new API knowledge instantly without causing "catastrophic forgetting" of unrelated knowledge.
- Trie-Guided & FA-Constrained Decoding: To eliminate hallucinations, the generation process is constrained by a combination of a Trie (prefix tree) and a Finite Automaton (FA). The Trie ensures that the model only generates valid subword token combinations that match actual API names. The FA governs the structural layout (e.g., enforcing correct separators and list formats).
- Smart Deduplication: Rather than blindly banning tokens that have already been generated, EVOREC uses subtree reachability. It only blocks a path if its entire subtree contains no remaining unused services, allowing valid shared prefixes (like
google-mapsandgoogle-api) to coexist safely. - Retrieval-Augmented Prompting (RAG): A dense retrieval module pulls relevant few-shot examples from the service corpus at inference time to provide immediate context to the backbone model (Qwen2.5-7B).
Datasets
The framework was evaluated across three distinct datasets:
- ProgrammableWeb: A real-world web service dataset containing 22,457 Web APIs and 8,217 mashups. The authors split this chronologically into three segments to realistically simulate service evolution over time.
- Java/Python Dataset: A dataset containing 3,925 Python and 6,563 Java APIs paired with natural language queries.
- Code-Context Dataset: A dataset consisting of 4,146 API usage entries across 3,136 source code files from 853 Java projects, used to test recommendations within actual programming environments.
Key Insights and Ideas
- Separation of Concerns: A key "aha moment" is the tight integration of model editing and constrained decoding. Model editing handles knowledge acquisition (updating what the model knows internally), while constrained decoding handles validity enforcement (ensuring the output is executable). This separation keeps the system incredibly stable.
- The Power of Localized Updates: Rank-one updates to linear projection layers act like a surgical strike, changing specific key-value associations while completely avoiding the representation drift that plagues full fine-tuning.
- Reshaping Probability Space: Constrained decoding doesn't just filter bad outputs; it actively reshapes the model's probability distribution, systematically driving down generation entropy (uncertainty) and forcing the model into a structurally valid subspace.
Key Results
- Overall Accuracy: EVOREC achieved an average relative improvement of 25.9% in Recall@5 over traditional information retrieval and deep learning baselines.
- Handling Evolution: In dynamic scenarios where test instances explicitly required newly introduced services, EVOREC outperformed standard fine-tuning approaches by 22.3%, proving its superior adaptability to ecosystem shifts.
- Code Scenarios: In practical code environments, EVOREC achieved a 70.6% Recall@5, substantially outperforming the original base model and fine-tuned variants.
Limitations and Future Work
- Probability Conflicts: The strict Finite Automata constraints can occasionally conflict with the model's native probability distribution. For example, if the model strongly wants to output a bracket or a separator that violates the FA state, it causes an abrupt drop in log-probability, which can hurt the model's ability to smoothly terminate generation automatically (leading to lower precision).
- Scalability Limits: While model editing is highly effective for localized and frequent updates, its long-term stability under massive, sequential, or large-scale edits remains an open challenge that could lead to incomplete generalization.
- Future Directions: The authors suggest exploring adaptive logit reweighting or constraint relaxation techniques to smooth out these decoding-model inconsistencies.
Summary updated