Full text
GREX: A platform for supporting explanations in group recommender systems Mateus Toledo1[0009−0008−9721−9709], Raciel Yera1[0000−0001−9759−261X], Manuel J. Barranco1[0000−0002−2474−1909], and Bapi Dutta1[0000−0002−2796−8914] University of Jaén, Campus Las Lagunillas s/n, 23007, Jaén, Spain [email protected] https://sinbad2.ujaen.es/ Abstract. Although explainability is critical for trustworthy AI, Group Recommender Systems (GRS) lack dedicated, flexible software tools. To address this, we present GREX, a novel, open-source Python library designed to facilitate the development and evaluation of explanations in group settings. GREX is built on a modular and extensible architecture, providing implementations of three distinct explanation paradigms: counterfactual (Sliding-Window-Weighted), rule-based (EXPGRS), and local model-agnostic (LORE4GROUPS). We conducted a comprehensive description of GREX stages, overall including data preparation, training, recommendation, and explanation. GREX is focused on empowering researchers and practitioners to systematically develop and compare Explainable AI (XAI) methods, fostering progress in transparent and user-centric GRS. Keywords: Group Recommender Systems (GRS) ·Explainable AI (XAI) ·Software library 1 Introduction Recommender systems have become an integral part of many online platforms, guiding users to discover relevant products, services, or content amidst overwhelming choices [4]. Traditionally, these systems focus on individual users by analyzing their preferences and behaviors to generate personalized suggestions. However, in many real-world scenarios, decisions are made collectively by groups rather than individuals. Group recommender systems address this need by aggregating the preferences and characteristics of multiple users to provide recommendations that satisfy the group as a whole [6]. This emerging area extends the challenges of traditional recommender systems, introducing unique complexities related to preference aggregation, fairness, and group dynamics. Artificial intelligence (AI) technologies influence various aspects of daily life; therefore, the importance of explainability has grown significantly. Explainability in AI refers to the ability to provide clear, understandable reasons behind the outputs or decisions of an algorithm. In recommender systems, explanations can enhance user trust and satisfaction by helping users understand why certain items are suggested [20]. Furthermore, explainability supports transparency and This preprint has not undergone peer review (when applicable) or any post-submission improvements or corrections. The Version of Record of this contribution is published in Proceedings of IDEAL 2025. LNCS 16239, and is available online at https:// doi.org/10.1007/978-3-032-10489-2_9
2 M. Toledo et al. accountability, which are essential for addressing ethical concerns such as bias and fairness. In the context of group recommendations, providing explanations becomes even more challenging, as it involves communicating the rationale behind suggestions made to diverse users with potentially conflicting preferences [21]. Despite increasing research interest in explainable recommender systems (XRS), there is still an important gap in the availability of dedicated software libraries that support explanation generation, especially for group recommendation. Although there are several frameworks and tools for building and evaluating recommendation algorithms [5,6,8,9,10,17], few offer modular and extensible components explicitly designed to produce interpretable explanations for groups. This lack limits the ability of researchers and practitioners to systematically develop, benchmark, and deploy explainability methods in group recommendation contexts, thereby hindering progress in the field. In this work, we present a novel open-source library aimed at bridging this gap by providing a comprehensive set of explanation approaches tailored for group recommender systems. Our library offers modular implementations of state-ofthe-art techniques, flexible integration with existing recommendation models, and evaluation tools for explainability quality. We aim to facilitate research and practical adoption of explainable group recommendations, ultimately fostering more transparent and trustworthy recommender systems. 2 Related Works 2.1 Explanations in group recommender systems Several studies have explored ways to justify or explain group recommendations from diverse perspectives. Early works have incorporated visual tools: Wang et al. [17] used hierarchical graphs and pie charts to depict group influence, while Quijano et al. [14] emphasized the social dynamics behind group decisions to improve acceptance. Similarly, Marquez et al. [11] focused on negotiation-based recommendation, offering visual explanations of evolving group preferences. More recently, Yera et al. [21,22] have been focused on discovering relationships based on previous preferences over item and item features, for justifying item recommendations. The latest research has explored novel interfaces and explanation types; Al-Hazwani et al. [1] combine conversational AI with bivariate map visualizations to foster transparent consensus-building, while Stratigi et al. [15] have proposed sliding windows-based approaches for identifying counterfactual explanations for item recommendations. Explanations based on social choice and aggregation strategies have also attracted the attention of the research community. Najafian et al. [12], Trang Tran et al. [16], and Barile et al. [3] examined how preference distributions influence the effectiveness of different aggregation-based explanations, showing that group configuration affects interpretability. Recent work has turned to innovative paradigms: Waterschoot et al. [18,19] explored large language models for
Title Suppressed Due to Excessive Length 3 generating and assessing group explanations. Still, as noted by Alvarado et al. [2], the field calls for deeper investigation beyond user studies. 2.2 Previous libraries for supporting explanations in recommender systems Several libraries have supported research in recommender systems across the last decade [8,9,10]. However, there is a limited availability on libraries for supporting recommendation explainability. A remarkable exception to this shortcoming is RecoXplainer [5], which is a software library designed to facilitate the development and offline evaluation of explainable recommender systems. The authors highlight a common challenge in the field: while there is growing interest in explainability due to its potential to improve user trust, understanding, and acceptance, researchers often lack access to standardized tools and must re-implement existing methods from scratch. RecoXplainer addresses this gap by offering a unified and extensible framework that brings together a variety of explainability techniques and recommendation algorithms in a single platform. The library supports both model-based and post-hoc explanation approaches and includes several black-box recommender models. In addition to its modular design, it provides a set of offline evaluation metrics specifically aimed at assessing the quality of explanations. This makes it possible not only to prototype new explainability strategies but also to compare them systematically. Inspired by RecoXplainer, the goal of our contribution is the development of a library for supporting the explanation generation process in group recommender systems. 3 GREX: A novel library for supporting explanations in group recommendation In this section, we introduce GREX, a software library developed to facilitate research and experiments on explanations for group recommendation. We begin by detailing its foundational architecture, which is designed for modularity and flexibility. Subsequently, we describe the specific components implemented within the library, covering a range of techniques for recommendation, aggregation, and explanation. 3.1 General architecture The library operates within a highly defined pipeline workflow, which consists of Data Preparation, Group Handling, Model Selection and Training, Recommendation, Explanation, and Evaluation. A key feature of our library is that these stages are modular. This means that the choice of a specific machine learning (ML) model, for instance, does not restrict the selection of a group strategy or
4 M. Toledo et al. an explanation method. This design allows for a flexible combination of components, enabling users to configure them as required. The entire architecture is illustrated in Figure 1. Fig. 1. GREX diagram 3.2 Components of the library: group recommender and explanation approaches Recommendation Generation Once a model has been trained (ML models available, taken as reference Coba et al. [5]: ALS,BPR,Autoencoder,EMF,GMF, MLP,KNNBasic, and SVD), the Recommendation Generation stage uses it to produce ranked lists of items. The library provides distinct components for this process, reflecting the different requirements for recommending to individual users versus groups, both following a Recommender abstract component. Although the library supports standard individual recommendations through the Individual Recommender component, its main contribution lies in the specialized process for generating group recommendations, which is handled by the GroupRecommender component. The workflow is as follows: –Setup and Candidate Selection: The process is initiated by calling the setup recommendation method. This crucial first step takes the list of group members, the trained model, and the aggregation strategy it will use as input. It then prepares a pool of candidate items for recommendation, which filters
Title Suppressed Due to Excessive Length 5 out any items that have already been seen by at least one member of the group. This ensures that the recommendations are novel for all members. –Individual Preference Collection: After establishing the candidate items, the preferences of each individual member are gathered for these items. It iterates through each user in the group and utilizes the trained model’s prediction to obtain a set of prediction scores for every item in the candidate pool. This step results in a collection of individual prediction lists, one for each group member. –Score Aggregation: With the individual predictions collected, the next step is to aggregate them into a single score that represents the group’s collective preference for each item by applying an aggregation strategy. The library currently supports strategies for the aggregation of individual predictions, which have been detailed in Felfernig et al. [7]. –Final Recommendation List: Finally, the aggregated scores are sorted in descending order to produce a top-N recommended list of items for the group. Explanation Generation Following the generation of recommendations, the Explanation Generation stage aims to provide transparency by clarifying why certain items were recommended to a group. The library is designed to be a comprehensive framework for XAI in group recommender systems, supporting multiple paradigms to generate explanations. The current approaches are: –Counterfactual Explanations (Sliding-Window-Weighted (SWW)): Inspired by the work of Stratigis et al. [15], the Sliding-Window-Weighted (SWW) approach generates counterfactual explanations by identifying the minimal set of items that, if removed from a group’s interaction history, would alter the recommended item. We extend their method by introducing a novel metric and a weighted final score. The full set of scores used to rank candidate explanations is: •Item Popularity Score: pop(U, i) = P∀u∈Uρ(u, i). •Rating Score: rate(G, i) = P∀u∈Gρ(u,i) |G|. •Item Intensity Score: int(G, i) = P∀u∈Gr(u,i) |G|. •Relevance Score: rel(G, i, t) = P∀u∈Gh(u, i, t). •Trending Score: Our novel metric analyzes interaction timestamps to identify "hype periods" and scores items based on whether group members engaged with them during these trends. trend(G, i) = 1 |G|P∀u∈Gtrend(u, i) Furthermore, unlike the original approach, we combine these metrics into a weighted composite normalized score. This allows for adjusting each component’s influence for a more balanced and configurable ranking. composite(G, i) = Pk∈Kwk·scorek(G, i)The final ranking is determined by sorting items by this composite score: rankitems =argsortdesc{composite(G, i) : ∀i∈I} –Rule-Based Explanations (EXPGRS): Based on the framework by Yera et al [22], this method uses pre-computed association rules to explain recommendations. An explanation is generated if enough group members satisfy
6 M. Toledo et al. a rule’s antecedent for the recommended item. The method proposes two types of rule explanations: •Type I: At least ’n’ members of the group share the same preferences (I=Iu). •Type II: The group’s combined preferences satisfy the rule (I=Su∈GIu). –Local Explanations (LORE4GROUPS): Being an implementation of the LORE4GROUPS method by Yera et al [21], this approach first generates local explanations for each member. A decision tree is built based on the neighborhood of similar items. It is used to extract a factual rule (r) justifying the recommendation and counterfactuals (ϕ) representing the minimal changes that would prevent it. The group explanation is then created by merging the factual rules from all members into a single rule rG, removing any contradictions. This combined rule is presented alongside the collection of all individual counterfactuals. e(G) =< rG, ϕu1, ϕu2, . . . , ϕuk>where rG=[ u∈G ru Evaluation We adopt a comprehensive evaluation protocol following recent XAI research [5,13,15,23]. The Evaluator component implements metrics for both recommendation accuracy and explanation quality. For the case of recommendation accuracy, we will use two main metrics [5]: –Hit Ratio (HR): Fraction of users with at least one relevant item in top-N recommendations [5]. –Normalized Discounted Cumulative Gain (nDCG): Evaluates ranking quality, giving higher scores to relevant items appearing earlier in the list [5]. Additionally, three explanation quality metrics are considered in GREX: –Model Fidelity (MF): The proportion of recommendations for which an explanation was successfully generated. This was applied to EXPGRS and LORE4GROUPS. [23] –Gaussian Intra-List Distance and Dispersion (GILD): Measures the diversity of explanations within a group using the average kernel distance between them. Higher values indicate greater diversity. This was applied to EXPGRS and LORE4GROUPS. [13] –Item Metrics: Refers to the individual component scores (e.g., Popularity, Rating, Trending) and the final Composite Value calculated for the Sliding Window method.[15] 4 Scenario of use and discussion This section presents our framework and discusses it within practical scenarios of use. The primary goal is to understand the performance and inherent trade-offs of the different explanation methods when applied to group recommendations. The source code and our results could be explored in our GitHub repository. 1. 1https://github.com/toledomateus/pygrex
Title Suppressed Due to Excessive Length 7 4.1 Scenario of use - Web application Here, a scenario of the use of GREX is presented, which is implemented through a web application that goes through the different components of the library. Initially, Figure 2 illustrates how the different data can be loaded, including the input of the rating data, the groups composed, and the binarization threshold for prediction models based on implicit feedback. Fig. 2. Data preparation stage in GREX Subsequently, the model selection and training stage allows the choice of the model that will be used for the rating prediction (Figure 3), among the several well-known approaches such as Alternative Least Squares, Bayesian Personalized Ranking, etc [5]. For each approach, the values of each associated parameter could be also assigned. After training, the user can get their offline evaluation. Once the individual rating prediction is configured, the next stage (Figure 4) is centered on selecting the group recommendation aggregation strategy to use from those pointed out in Felfernig et al. [7], and the group for which the recommendation will be delivered. The size of the top n recommendation list can be also fixed as parameter. Finally, Figure 5 illustrates the explanation stage, which settings depend on the used explanation approach. Particularly, this figure illustrates the interface associated to the approach Yera et al. [21]. In Figure 6 is possible to visualize the explanation in 4 tabs: 1) Decision Tree, shows the complete local model generated for the item; 2) Decision Path, highlights the specific rules that led to the recommendation; 3) Alternatives, presents individual members counterfactuals explaining what changes would lead to a negative recommendation; and 4) Group Analysis, summarizes the group’s consensus and individual members’ concerns.
8 M. Toledo et al. Fig. 3. Training stage in GREX (a). Getting the offline model evaluation (b) Fig. 4. Recommendation stage in GREX For the remaining two approaches Sliding Window [15] and EXPGRS [22], tailored interfaces are also developed. 4.2 Scenario of use - Scripting In addition to web application, the library is designed for programmatic use through API calls, making it suitable for integration into production systems or for research purposes within environments like Jupyter notebooks. Installation is straightforward via PyPI (‘pip install pygrex‘) or by building the artifact from the source repository. Below we provide a minimal end-to-end workflow, from data loading to explanation. This demonstrates how the core components of the library can be scripted to perform the main tasks of the recommendation pipeline.
Title Suppressed Due to Excessive Length 9 Fig. 5. Explanation stage in GREX Fig. 6. Details of LORE4GROUPS explanation. (a) Decision Three, (b) Decision Path, (c) Alternatives, (d) Group consensus