Table of Contents
Fetching ...

WAR-Re: Web API Recommendation with Semantic Reasoning

Zishuo Xu, Dezhong Yao, Yao Wan

TL;DR

WAR-Re tackles the dual challenges of adaptive API cardinality and interpretable justifications in Web API recommendation by combining an LLM-based recommender with semantic reasoning. It introduces dedicated start/stop tokens to handle variable API outputs and a two-stage training pipeline—supervised fine-tuning plus Group Relative Policy Optimization (GRPO) with LoRA—to optimize both recommendation accuracy and rationale quality. Using DeepSeek-R1 for rationale augmentation and TinyLlama as the backbone, WAR-Re achieves state-of-the-art performance on ProgrammableWeb, achieving up to 21.59% gains in accuracy and high reasoning quality as measured by RP, RR, and RS. The work demonstrates that integrating semantic reasoning with recommendation not only improves transparency but also enhances precision and reliability of API selections, with substantial evidence from ablation studies on tokens, training stages, and the reasoning component. The approach holds practical potential for developer tooling and API marketplaces by delivering adaptable, explainable mashup guidance.

Abstract

With the development of cloud computing, the number of Web APIs has increased dramatically, further intensifying the demand for efficient Web API recommendation. Despite the demonstrated success of previous Web API recommendation solutions, two critical challenges persist: 1) a fixed top-N recommendation that cannot accommodate the varying API cardinality requirements of different mashups, and 2) these methods output only ranked API lists without accompanying reasons, depriving users of understanding the recommendation. To address these challenges, we propose WAR-Re, an LLM-based model for Web API recommendation with semantic reasoning for justification. WAR-Re leverages special start and stop tokens to handle the first challenge and uses two-stage training: supervised fine-tuning and reinforcement learning via Group Relative Policy Optimization (GRPO) to enhance the model's ability in both tasks. Comprehensive experimental evaluations on the ProgrammableWeb dataset demonstrate that WAR-Re achieves a gain of up to 21.59\% over the state-of-the-art baseline model in recommendation accuracy, while consistently producing high-quality semantic reasons for recommendations.

WAR-Re: Web API Recommendation with Semantic Reasoning

TL;DR

WAR-Re tackles the dual challenges of adaptive API cardinality and interpretable justifications in Web API recommendation by combining an LLM-based recommender with semantic reasoning. It introduces dedicated start/stop tokens to handle variable API outputs and a two-stage training pipeline—supervised fine-tuning plus Group Relative Policy Optimization (GRPO) with LoRA—to optimize both recommendation accuracy and rationale quality. Using DeepSeek-R1 for rationale augmentation and TinyLlama as the backbone, WAR-Re achieves state-of-the-art performance on ProgrammableWeb, achieving up to 21.59% gains in accuracy and high reasoning quality as measured by RP, RR, and RS. The work demonstrates that integrating semantic reasoning with recommendation not only improves transparency but also enhances precision and reliability of API selections, with substantial evidence from ablation studies on tokens, training stages, and the reasoning component. The approach holds practical potential for developer tooling and API marketplaces by delivering adaptable, explainable mashup guidance.

Abstract

With the development of cloud computing, the number of Web APIs has increased dramatically, further intensifying the demand for efficient Web API recommendation. Despite the demonstrated success of previous Web API recommendation solutions, two critical challenges persist: 1) a fixed top-N recommendation that cannot accommodate the varying API cardinality requirements of different mashups, and 2) these methods output only ranked API lists without accompanying reasons, depriving users of understanding the recommendation. To address these challenges, we propose WAR-Re, an LLM-based model for Web API recommendation with semantic reasoning for justification. WAR-Re leverages special start and stop tokens to handle the first challenge and uses two-stage training: supervised fine-tuning and reinforcement learning via Group Relative Policy Optimization (GRPO) to enhance the model's ability in both tasks. Comprehensive experimental evaluations on the ProgrammableWeb dataset demonstrate that WAR-Re achieves a gain of up to 21.59\% over the state-of-the-art baseline model in recommendation accuracy, while consistently producing high-quality semantic reasons for recommendations.

Paper Structure

This paper contains 25 sections, 7 equations, 2 figures, 6 tables.

Figures (2)

  • Figure 1: Example of Web API recommendation with semantic reasoning.
  • Figure 2: The architecture of WAR-Re.