RuAG: Learned-rule-augmented Generation for Large Language Models

## Abstract

Abstract In-context learning (ICL) and Retrieval-Augmented Generation (RAG) have gained attention for their ability to enhance LLMs’ reasoning by incorporating external knowledge but suffer from limited contextual window size, leading to insufficient information injection. To this end, we propose a novel framework RuAG to automatically distill large volumes of offline data into interpretable first-order logic rules, which are injected into LLMs to boost their reasoning capabilities. Our method begins by formulating the search process relying on LLMs’ commonsense, where LLMs automatically define head and body predicates. Then, RuAG applies Monte Carlo Tree Search (MCTS) to address the combinational searching space and efficiently discover logic rules from data. The resulting logic rules are translated into natural language, allowing targeted knowledge injection and seamless integration into LLM prompts for LLM’s downstream task reasoning. We evaluate our framework on public and private industrial tasks, including natural language processing, time-series, decision-making, and industrial tasks, demonstrating its effectiveness in enhancing LLM’s capability over diverse tasks.

## 1 Introduction

Figure: Figure 1: Comparison of supervised fine-tuning, in-context learning/retrieval-augmented generation, and our proposed learned-rule-augmented generation (RuAG), which injects logic knowledge to boost generation while reducing computational cost.
Refer to caption: x1.png

Leveraging external datasets to enhance the performance of pretrained Large Language Models (LLMs) on downstream tasks has become a significant focus in recent research (Brown et al., ; ; Fan et al., ; Dong et al., ).
Methods such as supervised fine-tuning (SFT) (Hu et al., ; Li & Liang, ), in-context learning (ICL)(Dong et al., ; Wang et al., ; Ravi & Larochelle, ; Chan et al., ; Fang et al., ), retrieval-augmented generation (RAG)(Izacard et al., ; Fan et al., ), and the utilization of knowledge graphs (KGs) (Pan et al., ; Shu et al., ; Wang et al., ) have been explored to incorporate external knowledge into LLMs (Ding et al., ; Zhang et al., ), enhancing their reasoning and decision-making capabilities.

Despite these advancements, these methods face notable challenges. Fine-tuning large LLMs on extensive datasets is computationally intensive and time-consuming, often leading to overfitting and catastrophic forgetting (McCloskey & Cohen, ). ICL relies on handcrafted demonstrations and templates that may not effectively summarize large volumes of data, leading to inefficiencies and the “needle in a haystack” problem when processing long contexts (Li et al., ), and the extremely long context window significantly increases computational costs (Peng et al., ; Naveed et al., ). RAG depends heavily on the quality and relevance of retrieved documents and faces computational hurdles when integrating large-scale retrieval into prompts (Fan et al., ). Thus, RAG is not able to use the whole of vast knowledge base.
Knowledge Graph (KG) based methods incorporate structured representations of knowledge to improve LLMs’ understanding and reasoning (Pan et al., ; Shu et al., ; Wang et al., ). While KGs can enhance decision-making by providing explicit relational data, constructing and maintaining them requires significant manual effort and domain expertise, making scalability challenging.

Figure: Figure 2: Illustration of logic rules.
Refer to caption: x2.png

These challenges underscore the urgent need for efficient knowledge transformation to enhance LLMs’ understanding.
Logic rules, with their high information density, act as a promising bridge between vast, diverse data types (including numerical, textual, and visual data) and LLMs’ understanding. Previous work has demonstrated their learnability from external data and their efficiency in providing explanations to enable transparent AI processes (Qu & Tang, ; ). A logic rule, as shown in Figure 2, typically expressed as $\bm{\alpha}\rightarrow h$, indicates that if a set of events $\bm{\alpha}$ (referred to as body predicates) occurs, then the event $h$ (called the target predicate) will also occur. As an example, the logic rule $\text{``Temperature}\geq 30$ AND $\text{Humidity}\leq 50$ $\rightarrow$ Sunny Day” represents knowledge in symbolic structures, suitable for learning from data. Additionally, this rule can be easily translated into natural language: “If the temperature is 30 degrees or higher and the humidity is 50 percent or lower, it will be a sunny day.”
Logic rules are understandable to both humans and LLMs as they encapsulate complex relationships in a concise, structured form. Unlike lengthy text passages or extensive datasets in ICL and RAG, logic rules distill essential information into clear, interpretable statements. Compared to the complex node-and-edge structure of KGs, logic rules reduce cognitive load and align better with LLMs’ natural language training. Their direct translation into natural language further improves alignment with LLMs, facilitating more efficient processing and understanding.

Inspired by this, we propose a novel framework, learned-rule-augmented generation (RuAG), to automatically compress large external data into logic rules through LLM-aided Monte Carlo Tree Search (MCTS) (Świechowski et al., ) and then inform LLMs domain expertise by applying translated logic rules into prompts. Our framework consists of the following three phases.
LLM-based Logic Rule Search Formulation: Learning logic rules is expensive due to the involved human effort in formulating the domain-specific search process. Therefore, we automate this process by relying on LLMs’ commonsense to define the target and body predicates in logic rules.
First, the target predicate is defined to be task-relevant, like a class label in a classification task or a game state labeled as “win”, while the body predicates are initialized as all the data attributions in the dataset.
Then, given the task and dataset descriptions, LLM generates new target predicates and eliminates most irrelevant data attributions from the body predicates. For example, in navigation, LLMs may infer some special place as the key steps to the destination and suggest to search the rules for agents reaching the places individually. Also, LLMs may regard some data attributes as irrelevant to the target predicate, thus excluding them from the candidates. Consequently, the logic rule search space can be significantly reduced, and a domain-specific search process can be automatically established.
Logic Rule Search with MCTS:
Searching rules requires to discover the relationship among the predicates, suffering from the compositional search space (Qu & Tang, ; Zhang et al., ; Evans & Grefenstette, ).
To this end, RuAG exploits MCTS, which works well in large search spaces, to generate structured and understandable first-order logic rules, which are applied in the rule-based generation phase. Learned-Rule-Augmented Generation: RuAG translates the abstract logic rules into natural language and injects them into LLMs’ prompts.
By addressing the limitations of SFT, ICL, RAG, and KG-based methods, RuAG offers a scalable and computationally efficient solution for integrating extensive domain knowledge into LLMs, improving LLM’s reasoning, comprehension, and task performance with minimal manual intervention.

Our contributions are fourfold. First, we introduce a novel learned-rule-augmented generation framework as a potential alternative to SFT, ICL, RAG, and KG-based methods. This framework systematically and nearly automatically compresses external knowledge into compact, interpretable logic rules that prioritize enhancing LLM generation. Second, we propose an automated formulation for MCTS, eliminating the need for manual, domain-specific rule search and enabling a generalizable approach applicable across a wide range of tasks. Third, we apply MCTS to efficiently handle the large compositional search space of logic rule discovery. Fourth, we evaluate our framework across diverse scenarios, including public tasks in NLP (relation extraction on DWIE), time-series (log anomaly detection on HDFS), decision-making (the cooperative game Alice and Bob), and an industrial task in abuse detection, demonstrating the effectiveness of our approach in both academic and real-world settings.

## 2 Related Work

In this section, we review the most relevant topics related to our work, including the techniques to exploit external data in LLMs and logic rule learning.

External data usage in LLMs.
There are several ways to inject external knowledge into large language models. The most common way is supervised fine-tuning, but it suffers from high computational costs. In-context learning (Brown et al., ) prompts LLMs with a few handcrafted demonstrations which are understandable for the LLMs. More fancy, Retrieval-Augmented Generation (RAG)(Chen et al., ) complements LLMs by retrieved relevant knowledge from external databases (Li et al., ; Shen et al., ) or constructing demonstrations for in-context learning (ICL) (Poesia et al., ; Agrawal et al., ), showing promise in tasks like OpenQA (Borgeaud et al., ; Guu et al., ) and games (Zhu et al., ; Hu et al., ). Knowledge graphs are welcome in external knowledge formats as well, especially in structured tasks like relation extraction and entity recognition (Shu et al., ; Wang et al., ), improving task-specific decisions. Recent research also investigates how LLMs can summarize logic rules from large datasets to serve as a knowledge storage (Zhu et al., ; Luo et al., ), but shows high computational costs due to frequent calls to commercial LLMs (Brown et al., ; OpenAI, ).

Logic rule learning. Logic rules are increasingly employed to enhance the interpretability and accuracy of decision-making in AI systems (Chiu et al., ; An et al., ). Manually defined logic rules have been used to describe how certain events or outcomes are triggered by predefined conditions. However, this process is labor-intensive and highly domain-dependent (Evans & Grefenstette, ; Li et al., ). Researchers have explored automatic methods for extracting logic rules, such as statistical approaches and likelihood estimation (Cheng et al., ; ; Ru et al., ).
Despite these advances, the process still involves extensive domain knowledge and commonsense reasoning, requiring expert intervention to identify the candidate target and body predicates.

## 3 Enhance LLMs’ reasoning through applying logic rules

Figure: Figure 3: The framework of our novel learned-rule-augmented generation (RuAG). RuAG automatically compresses large external knowledge into compact logic rules using LLM-aided Monte Carlo Tree Search (MCTS), through three phases: LLM-based Logic Rule Search Formulation, Logic Rule Search with MCTS, and Learned-Rule-Augmented Generation. First, the LLM formulates the MCTS search by defining the target and body predicates. Then we apply MCTS to generate structured first-order logic rules, which are applied to guide generation. Our framework provides an efficient alternative to RAG.
Refer to caption: x3.png

In this section, we introduce RuAG, our novel approach to augment Large Language Models (LLMs) with logic rules learned from pre-collected training data. Instead of directly fine-tuning the LLM—which can be costly and prone to overfitting—or using retrieval-augmented generation limited by input length, we transform the data into concise logic rules. These rules encapsulate essential patterns and guide the LLM during generation, enhancing performance and interpretability.

As shown in Figure 3, RuAG comprises three key steps: 1) LLM-Based Logic Rule Search Formulation: leverage the LLM to automatically formulate the logic rule learning problem, defining predicates, actions, states, and rewards. (Section 3.1) 2) Logic Rule Search with Monte Carlo Tree Search (MCTS): employ MCTS to efficiently search for effective logic rules based on the LLM-formulated problem. (Section 3.2) 3) Learned-Rule-Augmented Generation: integrate the learned logic rules into the LLM’s generation process, improving its generation. (Section 3.3)

### 3.1 From Data to Rule Search: LLM-based Logic Rule Search Formulation

Search for logical rules traditionally requires significant human effort, particularly in defining domain-specific head predicates and selecting relevant features that characterize data samples. This process demands domain knowledge and impacts both the quality of the derived logic rules and the computational cost of search.
To address this challenge, our method begin with LLM-based Logic Rule Search Formulation, where we leverage the capabilities of LLMs to automatically formulate the logic rule learning problem through defining the predicates.

Initial Predicates. Given a dataset $\mathcal{D}=\{(\bm{x},y)\}$, where each data sample $\bm{x}=[x_{1},x_{2},\dots,x_{N}]\in\mathcal{X}$ is $N$-dimensional and $y\in\{0,1\}$ is the label, we initial the label as the target predicate and the features as the body predicates. We can directly translate discrete variables into Boolean values through one-hot vectors. For continuous variables, we can translate them into Boolean-valued attributes through Gini-index (Strobl et al., ). Therefore, each predicate is a Boolean-valued function representing a basic condition derived from the data.
Discrete variables can be directly translated into Boolean-valued through one-hot vectors. Continuous variables are translated into Boolean-valued attributes through Gini-index. Therefore, each predicate is a Boolean-valued function representing a basic condition derived from the data. Furthermore, we suggest prompting LLMs to remove impossible body predicates to reduce logic rules search space or suggest new target predicates to search more logic rules for a better understanding of the task.

Removing Impossible Body Predicates. Given a target predicate, the LLM aids in filtering out impossible or irrelevant body predicates, reducing the computational burden. By utilizing commonsense reasoning, the LLM can identify predicates that are unlikely to contribute to effective logic rules. For instance, in a system log analysis, the LLM might determine that certain attributes like user IDs are less relevant for anomaly detection compared to error codes or access patterns.

Suggesting New Target Predicates.
In addition to the primary target predicate (e.g., achieving a specific classification label), the LLM can suggest additional head predicates to explore. This is particularly useful in tasks requiring long-horizon planning, where intermediate goals can guide the search for effective logic rules. By generating these new head predicates, the LLM enables a more comprehensive exploration of the logic rule space.

Our LLM-based logic rule search formulation enjoys the following advantages:

- •
Automation and Scalability: The LLM automates the setup of the logic rule learning problem, $i.e.$, defining the target and body predicates, avoiding human experts, and making it scalable to large and complex datasets.
- •
Enriched rule generation: By generating relevant target predicates, our method can extract more meaningful rules.
- •
Reduced Computational Burden: By eliminating irrelevant predicates, the LLM narrows down the search space, improving efficiency.

### 3.2 Logic Rule Search with MCTS

Following the definition of predicates in logic rule searching, we apply Monte Carlo Tree Searching (MCTS) to perform logic rule learning, inspired by its effectiveness in searching optimal policy in large state spaces.

States, Actions, and Rewards in MCTS.
With the predicates defined, the state, action, and reward in MCTS for logic rule searching can be defined as:

- •
States ($S$): Each state represents a partial logic rule, consisting of a set of predicates. The initial state is the empty set, $S_{0}=\emptyset$. Subsequent states are defined as: $S_{n}=S_{n-1}\cup\{\alpha_{i}\}$,
where $\alpha_{i}$ is the predicate added by an action.
- •
Actions ($\mathcal{A}$): Actions involve adding a new predicate to the current state. The action space is defined as: $\mathcal{A}=\{\text{Add }\alpha_{i}\mid\alpha_{i}\text{ is a candidate
predicate generated by the LLM}\}$.
- •
Rewards ($\mathcal{R}$): The reward function evaluates the quality of a logic rule. For example, the reward for state $S_{n}$ can be defined as the precision of the rule evaluating on the dataset $\mathcal{D}$.

Typically, MCTS involves building a search tree and simulating outcomes to estimate the value of actions. It consists of four key phases: selection, expansion, simulation, and backpropagation.
Selection and expansion: The process begins at the root node, where the algorithm selects the most promising child nodes based on the Upper Confidence Bound applied to Trees (UCT). This continues until a leaf node is reached. If the leaf node is not terminal, new child nodes are created to explore potential moves. As an example, we expand a new node at the state of $[(\text{age}\geq 30),]\Rightarrow(\text{income}\geq\$50,000)$, if we select a new candidate predicate $(\text{income}\geq\$50,000)$ according to its UCT value, then we add it into the rule: $[(\text{age}\geq 30),]\leftarrow(\text{income}\geq\$50,000)$ and enter the new state of $[(\text{age}\geq 30),(\text{education}=\text{bachelor's})]\Rightarrow\text{
income}\geq\$50,000$.
Simulation: For the newly expanded nodes, random simulations (also known as rollouts) are performed to calculate the reward of the state.
Backpropagation: The calculated reward is then propagated back up the tree, updating the nodes’ statistical information. The UCT algorithm plays a crucial role in MCTS, balancing exploration and exploitation by selecting actions that maximize:
$UCT_{j}=\bar{X}_{j}+C\sqrt{\frac{2\ln N_{C}}{N_{j}}}$,
where $\bar{X}_{j}$ is the average reward of action $j$, $N_{C}$ is the total number of visits to the parent node, is the number of visits to node $j$, $C$ is a constant that adjusts the exploration-exploitation trade-off.

Finally, we collect all the rules constructed at the terminal nodes when 1) the constructed rule reaches a predefined maximum length (i.e., the number of body predicates exceeds a threshold).2) If the reward of the final node (i.e., the precision of the rule) exceeds a predefined threshold, indicating that the rule is sufficiently accurate.

### 3.3 learned-rule-augmented generation

After the logic rule search, we gather a set of logic rules and follow the following steps to perform learned-rule-augmented generation.
1) Clean Searched Rules: The collected rules may contain duplicates, exhibit low quality, or cover only a limited subset of the data. We first eliminate those with low rewards or minimal data coverage. Then, we compare each pair of rules and retain the one with the higher reward if its body predicates are a subset of the other’s.
2) Translate Rules into Natural Language: To enhance the LLMs’ comprehension, we translate these symbolic rules into natural language, resulting in a group of sentences. These sentences can then be injected into the LLM prompts to guide generation more effectively.
3) Retrieve Relevant Rules: It is optional to retrieve only the most relevant rules or inject all the rules, depending on the contextual window size and the long-text understanding capability of the LLM.
4) Generation: The generator component can be modeled using any LLM. We use GPT-4 (OpenAI, ) if no specific model is clarified. To combine the input with the rules during generation, we simply apply the rules in a prompt template.

## 4 Experiments

Most decision-making and prediction tasks can be abstracted into state chains to achieve their ultimate goals, which allows our method to adapt to a wide variety of tasks. In this section, we evaluate our method over diverse domains, including NLP (relationship extraction in Section 4.1), time-series predication (log-based anomaly detection in Section 4.2),
decision-making task (cooperative game (Chen et al., ) in Section 4.3) and a private industrial task (unauthorized party abuse detection in Appendix A).
We compare our method with the domain-specific baselines for each task and HtT (Zhu et al., ), which applies LLMs to generate rules. The specific implementation details of the experimental setup can be found in Appendix C.

### 4.1 Relation extraction

Document-level relation extraction is a critical task in natural language processing (NLP), where the goal is to identify and classify relationships between entities across entire documents rather than isolated sentences. This task becomes more complex at the document level due to the larger context and the need to resolve long-range dependencies and co-references between entities scattered throughout the document. However, using only LLMs for this task is often limited by their inability to consistently capture complex document-wide relationships, especially when reasoning across multiple entities and contexts.

Setup.
We conduct experiments on the DWIE dataset (Zaporojets et al., ), which contains 802 documents and 23,130 entities. After excluding irrelevant articles, 700 documents are used for training and 97 for testing. During the rule extraction process, we leveraged the LLM to filter out 15% of the relationships that were unlikely to serve as valid predicates. We evaluate the performance of our method using standard relation extraction metrics, including Precision, Recall, and F1-score. For comparison, we evaluate our method against several state-of-the-art models for document-level relation extraction, including CNN, BiLSTM (Yao et al., ), Context-Aware (Sorokin & Gurevych, ), and BERT-based models(Shi & Lin, ), which are widely used in document-level relation extraction tasks. Additionally, we compare with the LLM-based HtT(Zhu et al., ) model, which employs predefined logical rules to extract relations. These comparison methods provide a comprehensive benchmark for assessing the effectiveness of our approach in extracting relations at the document level.

**Table 1: Experimental Results on Relation Extraction.**
|  | Model | F1 | Precision | Recall |
| --- | --- | --- | --- | --- |
| DL-based | CNN | 43.78% | 47.13% | 45.03% |
| BiLSTM | 48.17% | 44.32% | 41.53% |  |
|  | Bert | 49.84% | 49.35% | 54.13% |
|  | Context-Aware | 45.37% | 49.87% | 38.76% |
| LLM-based | HtT (GPT3.5) | 22.55% | 35.76% | 16.46% |
| HtT (GPT4) | 52.59% | 68.20% | 42.80% |  |
| Ours (GPT3.5) | 26.63% | 39.82% | 20.00% |  |
| Ours (GPT4) | 60.42% | 69.44% | 53.48% |  |

Main Results.
As shown in Figure 1, our method outperforms both deep learning-based and LLM-based baselines in document-level relation extraction. DL-based methods that leverage richer contextual information tend to achieve better performance. For instance, BERT and BiLSTM outperform CNN, demonstrating the importance of modeling long-range semantic dependencies in document-level relation extraction. Additionally, the results highlight the potential of LLM-based methods in this task. When using GPT-4 as the base model, LLM-based approaches surpass DL-based methods, showcasing the effectiveness of large language models in capturing complex document-level relationships. Moreover, our method outperforms HtT in both GPT-3.5 and GPT-4 settings. This is because HtT extracts rules from a single document, which limits its global perspective, while the predefined rules may not fully represent the broader context. In contrast, our method utilizes MCTS to search for rules from a global viewpoint, effectively mining potential rules from the training data. This approach ensures efficiency while maintaining the reliability of the rules during the search process. By combining the learned logic rules with the reasoning power of LLMs, our method achieves more accurate and comprehensive relation identification, distinguishing it from both traditional DL-based models and other LLM-based methods. With GPT-4, our method reaches an F1-score of 60.42%, significantly outperforming other methods, highlighting the strength of our approach in document-level relation extraction.

### 4.2 Log-based anomaly detection

Log-based anomaly detection is fundamentally a time-series prediction task, where the goal is to predict whether a sequence of log events indicates abnormal system behavior. This task is crucial for maintaining system reliability and security by identifying patterns that signal potential failures or attacks. Given the temporal nature of log data, both sequential patterns and the semantic content of the logs must be analyzed to accurately detect anomalies. Effective anomaly detection in time-series log data is essential for preventing system downtime and ensuring the smooth functioning of distributed infrastructures.

Setup. We evaluate our method on the HDFS dataset (Xu et al., ) for the log-based anomaly detection task. This dataset consists of over 11 million log entries generated from Hadoop-based map-reduce jobs on more than 200 Amazon EC2 nodes. In practice, we sampled 20,000 blocks of log sequences from the HDFS dataset, consisting of approximately 486,060 log entries. The dataset was split chronologically into training, validation, and test sets with a ratio of 8:1:1. We evaluate our method using F1 score (F1), Precision, and Recall to compare it against several baselines. The baselines include traditional methods like LogCluster  (Lin et al., ), DeepLog (Du et al., ), and LogRobust (Zhang et al., ), as well as LLM-based models like Vanilla, HtT, and LogGPT (Qi et al., ), providing a comprehensive assessment of performance across various approaches.

**Table 2: Comparison under different methods on Log-based anomaly detection.**
|  | Mehtod | F1 | Precision | Recall |
| --- | --- | --- | --- | --- |
| Traditional | LogCluster | 70.97% | 96.70% | 56.05% |
| DeepLog | 53.55% | 53.74% | 65.08% |  |
| LogRobust | 87.31% | 89.12% | 85.54% |  |
| LLM-Based | HtT | 58.73% | 45.46% | 82.31% |
| LogGPT | 72.56% | 56.82% | 100% |  |
| Ours | 92.59 | 86.21% | 100% |  |

Main Results.
Table 2 compares our method with traditional baselines and LLM-based models on the log-based anomaly detection task.
Traditional deep learning methods heavily rely on the training dataset, generally suffering from limited generalization ability and difficulty in discovering new anomalies. As a result, they perform poorly here.
The LLM-based models, all based on GPT-4, demonstrate their potential even with a prompt-based approach. LogGPT achieves an F1 score of 72.56% and a perfect recall of 100%, highlighting the LLM’s ability to infer system anomalies from semantic information like abnormal keywords. However, LogGPT’s precision is less ideal (56.82%), due to the lack of domain-specific knowledge, leading it to misclassify minor issues as anomalies. HtT, which learns anomaly patterns from training data and provides them to the LLM for detection, performs worse than LogGPT with an F1 score of 58.73%, due to inefficiencies in handling large-scale data and difficulties in identifying global patterns.
In contrast, our method leverages MCTS to efficiently extract the most reliable rules from the entire dataset, providing clear guidance to the LLM. This approach results in 100% recall and significantly improves precision by addressing the LLM’s tendency to misclassify normal log sequences. As a result, our method achieves an F1 score of 92.59%, outperforming all baselines.

### 4.3 Multi-agent game: Alice&Bob

In the real world, plenty of scenarios involve decision-making, planning, and collaborating, especially in partially observable environments. Moreover, often the optimal strategy often contradicts human intuition. You can not walk towards the treasure directly as there may be walls blocking the path. In such tasks, it is crucial to inject domain knowledge to make informed decisions, as only by integrating specific domain expertise can the model accurately identify the optimal strategy and make sound judgments.

Setup.
We choose the cooperative multi-agent game Alice&Bob, which requires both planning and collaboration. In the game, Alice and Bob work together to find the treasure (Chen et al., ), and the optimal paths for both agents often go against intuition. They are required to sequentially experience key blocks, with one agent needing to remain on a block to enable the other to obtain the treasure. Episodes last up to 50 steps.
Metric We evaluate the method by reporting the average win rate (WR), the accumulative rewards (AR), and the average episode length (AL) across $30$ episodes.
Baselines We compare our method with RL baselines (behavior cloning; offline tabular Q), rule generated method (PLLB (Srivastava et al., ) and HtT (Zhu et al., )), RAG, ICL-Good (ICL with good demonstrations) and ICL-Contrastive (ICL with both good and bad demonstrations). We provide the results of random policy and LLM-based grounded policy (with handcraft rules) as well.
Data Collection We collect $1000$ episodes of trajectories by applying a handcraft policy where the agent has the probability of $p$ to follow the optimal policy and $1-p$ to follow a random policy. We set $p=0.7$ in the default setting.
Generated target predicates by LLMs We search the logic rules from different aspects following the LLMs’ suggestion: 1) team reward = -10; 2) Alice or Bob stand on yellow, purple, skyblue blocks; 3) Game Win.
During the evaluation, we make different LLM serves as Alice and Bob, providing them with the observations, historical information, and the action space and prompting them to respond with the chosen action.

**Table 3: Experimental results over the decision-making task, Alice&Bob. The standard error is provided in the bracket.**
|  | Method | AR | AL | WR (%) |
| --- | --- | --- | --- | --- |
| RL-based | Behavior Cloning | 54.67($\pm$51.82) | 32.46 | 0.56 |
| Offline Tabular Q | 59.51($\pm$52.71) | 32.60 | 0.63 |  |
| LLM-based | Vanilla | -0.08($\pm$0.11) | 50.0 | 0.0 |
| ICL-Good | -0.71($\pm$0.55) | 50.0 | 0.0 |  |
| ICL-Contrastive | -0.83($\pm$0.66) | 50.0 | 0.0 |  |
| RAG | -0.14($\pm$0.22) | 50.0 | 0.0 |  |
| HtT | -0.26 ($\pm$0.22) | 50.0 | 0.0 |  |
| PLLB (Offline) | -0.15($\pm$0.26) | 50.0 | 0.0 |  |
| Ours | 69.45($\pm$46.1) | 33.23 | 0.7 |  |
|  | Random | -2.2($\pm$0.52) | 50.0 | 0.0 |
|  | Grounded | 89.87($\pm$30.06) | 32.1 | 0.9 |

Main Results.
In Table 3, we compare the performance of various RL-based and LLM-based methods on the Alice $\&$ Bob task. Overall, our method achieves the sota performance. RL-based methods perform relatively well and surpass most LLM-based methods, as they can accumulate knowledge during training.
In contrast, LLM-based methods face significant challenges in this task. Methods like Vanilla, ICL-Good, and ICL-Contrastive show negative accumulative rewards (-0.08, -0.71, and -0.83, respectively) with a win rate of 0, indicating a clear lack of strategy reasoning and task optimization. Vanilla performs badly due to the absence of domain knowledge. However, once domain knowledge is correctly incorporated, performance improves significantly, as seen with methods like MCTS (win rate of 0.7) and Grounded Policy ( win rate of 0.9). Among those external-knowledge enhanced generation methods, ICL, and RAG insert relevant demonstrations, however perform bad as LLMs may suffer from long-text understanding. HtT, and PLLB relay on LLM to summarize rules, which not only need to understand long text but also require more domain knowledge than our method to summarizing rules, therefore the summarized rules may not provide enough domain knowledge for LLMs.

**Table 4: Searched rule examples across different tasks.**
| Task | Rule | Description |
| --- | --- | --- |
| Relation<br>extraction | head_of_gov $\rightarrow$ citizen_of | If a person holds the position of head of government, they are also a citizen of that country. |
| head_of_gov-x $\rightarrow$ citizen_of-x | If a person holds the position of head of government in a nominal variation of a country, they are also a citizen of that nominal variation of the country. |  |
| Anomaly<br>Detection | $E11,E28\rightarrow abnormal$,<br>$conf=0.96$ | If events E11 and E28 occur sequentially, it indicates a high probability of anomaly with a confidence of 0.96. |
| $E11,E26,E20\rightarrow abnormal$,<br>$conf=0.99$ | If events E11, E26, and E20 occur sequentially, it indicates a very high probability of anomaly with a confidence of 0.99. |  |
| Cooperative<br>Game | [IsGreen(Alice’s Center Left) & MoveRight(Alice) & $d_{x}$(Alice, treasure)=0 & $d_{x}$(Alice, treasure) & Stand(Bob, skyblue) & VisitedSkyblue(Bob) & VisitedPurple(Bob) & VisitedYellow(Alice) ] $\rightarrow$ Game_Win | When Alice’s center right block is green, if Alice moves right, then the team will receive a Reward = 100.0. In all these cases, Alice locates at 0 blocks down, 1 block to the left of the treasure, Bob stands on skyblue block, Bob visited skyblue block, Alice visited yellow block, Bob visited purple block. |

### 4.4 Ablation Study

In this section, we present an ablation study to evaluate the robustness and effectiveness of our method across several dimensions. First, we analyze the performance of our method when using different LLM backbones, examining whether the choice of LLM impacts overall task performance. Second, we explore the contribution of different components in our method, including the use of chain-of-thought (CoT) reasoning and rule-based guidance, to assess how each component improves the task. Lastly, we investigate the effectiveness of the MCTS rule extraction process by varying the number of search episodes.

**Table 5: Ablation on LLM backbones across different tasks.**
| Backbone | Method | Relation Extraction | Log Anomaly Detection | Cooperative Game |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| F1 | Precision | Recall | F1 | Precision | Recall | AR | AL | WR |  |  |  |
| GPT3.5 | Vanilla | 18.94% | 31.06% | 13.62% | 48.42% | 62.71% | 39.43% | -0.58($\pm$0.47) | 50.0 | 0.0 |  |
| +CoT | 19.85% | 28.19% | 15.32% | 73.19% | 75.42% | 71.08% | -0.38($\pm$0.26) | 50.0 | 0.0 |  |  |
| +rule | 26.63% | 39.82% | 20.00% | 91.39% | 100.00% | 84.16% | 45.2($\pm$49.81) | 42.73 | 0.45 |  |  |
| GPT4 | Vanilla | 46.94% | 69.61% | 35.41% | 60.10% | 47.05% | 83.16% | -0.08($\pm$0.11) | 50.0 | 0.0 |  |
| +CoT | 48.10% | 66.13% | 37.39% | 76.11% | 94.69% | 63.62% | -0.83($\pm$0.66) | 50.0 | 0.0 |  |  |
| +rule | 60.42% | 69.44% | 53.48% | 92.59% | 86.21% | 100.00% | 69.45($\pm$46.1) | 33.23 | 0.7 |  |  |

Ablation on different LLM backbones. Table 5 presents the results of our ablation study on different LLM backbones across relation extraction, log anomaly detection and cooperative games. It compares baseline models (Vanilla), chain-of-thought (CoT), and our RuAG for GPT-3.5 and GPT-4.
While CoT improves performance by promoting step-by-step reasoning, it falls short in tasks requiring domain knowledge. In contrast, RuAG learned rules from external data, provides the required context, and consistently enhances performance across different backbones.

Ablation on searching episodes in MCTS. Table 6 shows the impact of MCTS search episodes for three tasks. In relation extraction and cooperative games, we report the number and accuracy of extracted rules are evaluated, while log anomaly detection is assessed based on the final task performance. According to the results, fewer search episodes still yield high-quality rules. Increasing episodes expands the search space, leading to more rules, but with diminishing returns as excessive episodes introduce ineffective searches and, in some cases, incorrect rules (e.g., relation extraction).

**Table 6: Ablation on searching episodes in MCTS. Num. denotes the number of searched rules.**
| Times | Relation Extraction | Anomaly Detection | Cooperative Game |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- |
| Num. | Precision | F1 | Precision | Recall | Num. | Precision |  |
| 50 | 13 | 100% | 65.75%% | 100.00% | 48.89% | 14 | 100% |
| 200 | 20 | 100% | 86.86% | 98.7% | 77.55% | 16 | 100% |
| 500 | 21 | 100% | 91.30% | 100% | 84% | 21 | 100% |
| 1000 | 23 | 95.65% | 91.30% | 100% | 84% | 23 | 91.30% |

Ablation on hyperparameter $p$ for data collection in decision-making task. We adjust the probability $p$ of performing optimal policy and report the searched rule numbers and their precision in Table 7 to investigate the impact of data collection policies on the searched rules.

**Table 7: Ablation on hyperparameter $p$.**
| $p$ | Num | Precision |
| --- | --- | --- |
| 0.2 | 25 | 80% |
| 0.5 | 35 | 88% |
| 0.7 | 21 | 100% |

### 4.5 Case Study

Figure: Figure 4: Case studies on relation extraction, log-based anomaly detction and cooperative game.
Refer to caption: x4.png

In this section, we present a case study to demonstrate how the extracted rules help LLMs perform tasks more effectively across different domains. The extracted rules serve as a guiding mechanism, assisting the LLM in making more accurate predictions and improving task performance by providing structured logic and patterns that the LLM can follow.
Figure 4 illustrates the most representative cases where extracted rules helped LLMs improve performance across three tasks: relation extraction, log-based anomaly detection, and multi-agent gaming.

In the relation extraction task, without the aid of extracted rules, LLMs typically rely solely on the literal content of the document, extracting only obvious relational triples while missing more implicit ones. As shown in Figure 4(a), the LLM can infer the relationship (“Ariel Sharon”, “head_of_gov”, “Israel”) based on the document’s semantics. However, it misses the implicit relationship (“Ariel Sharon”, “citizen_of”, “Israel”). By providing the LLM with the rule “head_of_gov $\rightarrow$ citizen_of”, our method helps the LLM extract this additional, less obvious relation. This demonstrates how our rule-based approach enables LLMs to more comprehensively complete the relation extraction task by accounting for logical patterns that might otherwise be overlooked.

In log-based anomaly detection task, LLMs can struggle due to insufficient domain knowledge, leading to hallucination issues. In Figure 4(b), the log sequence lacks clear semantic indicators of an anomaly, making it difficult for the LLM to detect. Our method uses MCTS to extract rules from historical logs that indicate abnormal patterns. When processing a sample, the log sequence is matched with the rule base, and the corresponding rule along with its confidence score is provided to the LLM. This enables the LLM to combine semantic information with historical patterns and rule reliability to make accurate anomaly detections. In this case, Rule 1 triggered by “E11, E28” indicates a high probability of anomaly, allowing the LLM to correctly assess the system state.

In decision-making task (Figure 4 (c)), the vanilla LLM only takes as input the Bob’s observation, therefore have a straightforward policy to walk towards the treasure directly. However, RuAG awares Bob the domain-specific knowledge: to stand on the skyblue block is a significant step for your team sucess. Therefore, in RuAG, Bob choose to walk to skyblue block first. This cooperative game highlights the significance of domain-specific knowledge in decision-making task, and demonstrates the effictiveness of our RuAG to integrate domain-specific knowledge by logic rules.

## 5 Conclusion

In this paper, we introduce a novel framework RuAG that automatically distills large volumes of offline data into understandable first-order logic rules, which are then injected into LLMs to enhance their generation capabilities. By leveraging LLMs’ commonsense, we first automatically formulate the searching process through defining the target predicate and body predicates. Then, we apply Monte Carlo Tree Search (MCTS) to efficiently address the combinatorial search space. As consequence, our method discovers logic rules that can be seamlessly integrated into LLM prompts for downstream task reasoning. Empirical evaluations across a variety of tasks, including NLP, time-series, decision-making, and industrial applications, demonstrate the effectiveness of our approach in improving LLM performance over diverse domains.

## Ethics Statement

In this paper, we strictly obey the principles outlined in the ICLR Code of Ethics, including careful consideration of potential ethical concerns, including the impact on human subjects, data privacy, and fairness in algorithmic decisions. Specially, the three public datasets do not have potential risk. As for the private industrial dataset, we promise that any data used in this study were released in compliance with legal and ethical standards, and proper security measures were implemented to safeguard personal information.

## Reproducibility Statement

We provide the all the details of our method in the paper and appendix, including evaluation prompts, detailed experimental setup and implementation, hyperparameters for both LLM reasoning and MCTS. The code will be available upon the paper publication. These above ensure that others can reproduce our method.

## Appendix A Experimental results on private industrail dataset: Unauthorized Party Abuse detection

The Unauthorized Party Abuse (UPA) detection task is a binary classification problem, where the goal is to predict whether an incident is a case of UPA (IsUPA) based on a series of features. These features include both time-dependent data, such as resource acquisition velocities and user activity history, as well as static features, like resource descriptions and types of compromised subscriptions. The task is to accurately classify each event as either UPA or not, while maintaining high precision and recall to avoid misclassifying legitimate customer activities.

#### Setup

The dataset used for this task comes from a private industrial source, consisting of historical incidents of Unauthorized Party Abuse (UPA). It includes both time-dependent features, such as resource acquisition velocities and user activity history, as well as static features, like resource descriptions and types of compromised subscriptions. The dataset is imbalanced, with significantly fewer UPA cases compared to legitimate ones, and the overall data volume is large. To address this, we sampled a balanced dataset and tested the algorithm on smaller batches. For evaluation, we used common fraud detection metrics, including F1-score, Recall, Precision, and Accuracy. We compared our method against several baselines, including XGBoost, Decision Tree, and Rule Grounding. In Rule Grounding, the extracted rules were directly used for prediction to evaluate the effectiveness of rule extraction.

#### Implement Details

In our task, most features in the dataset are continuous. To adapt to the requirement of Monte Carlo Tree Search (MCTS) for discrete state mining, we used the Gini index to discretize these continuous features. Specifically, for each continuous feature, we divided it into 10 discrete states. The discretization process involved calculating the Gini index to determine the optimal split points, ensuring that each resulting interval maintains a high degree of data purity. Thus, each data sample was converted into a sequence of discrete states.

We used Monte Carlo Tree Search (MCTS) to extract rules from the training set. MCTS was initialized with a root node representing the initial state. Child nodes were created and expanded using the Upper Confidence Bound (UCB) formula. Simulations were performed to explore different paths, and optimal rules were generated for both IsUPA=1 and IsUPA=0 targets. The rollout was set to 500, and the reward was based on the precision derived from the rule. The maximum rule length was set to 5. Additionally, if a node’s precision exceeded 0.85, we considered it a terminal node, as further expansion was deemed unnecessary. This allowed us to collect all reasonable rules with lengths ranging from 1 to 5.

#### Main result

Table 8 shows the results of different methods on the small batch dataset for abuse detection. We observe that the rules extracted using MCTS achieve high precision, similar to traditional machine learning methods, but also exhibit a higher recall. This is because MCTS explores a broader search space, allowing it to capture a more comprehensive set of abuse patterns. On the other hand, directly using the LLM for this task yields poor performance, with an F1 score of only 22.64%. The lack of domain-specific knowledge and the difficulty in processing purely numerical features hinder the LLM’s effectiveness in this scenario.

However, our method, which provides the MCTS-extracted rules as historical guidance to the LLM, enables the LLM to make better decisions by combining the extracted rules with feature information from specific scenarios. The results indicate that our approach significantly improves the LLM’s performance on this type of numerical task. With the help of rules, the LLM’s F1 score increases to 96%, demonstrating the effectiveness of our method in guiding the LLM to handle such tasks better. The table shows several representative rules extracted using MCTS, along with their precision, recall, and F1-score if used directly for detection. As can be seen, just using the first rule alone yields an F1 score of 0.6623. Additionally, precision is crucial for rules in this task, as high precision means that the rule for predicting IsUPA=1 is highly reliable and unlikely to make false positive errors.

**Table 8: Comparison under different methods on Fraud detection**
|  | F1 | Precision | Recall |
| --- | --- | --- | --- |
| Decision tree | 83.72% | 100% | 72% |
| XGBoost | 88.89% | 100% | 80% |
| Rule grounding | 93.62% | 100% | 88% |
| Vanilla | 22.64% | 21.43% | 24% |
| Ours | 96% | 96% | 96% |

**Table 9: Representative rule, precision, and description of unauthorized party abuse detection.**
| Conditions | Target | Precision | Recall | F1 |
| --- | --- | --- | --- | --- |
| Feature1 $\leq$ 0.030 and Feature2 is 1 and 0.003 $<$ Feature3 $\leq$ 0.547 | 1 | 0.8632 | 0.5372 | 0.6623 |
| 0.348 $<$ Feature4 $\leq$ 0.712 | 1 | 0.8229 | 0.4202 | 0.5563 |
| Feature1 $\leq$ 0.030 and Feature2 is 1 and 0.258 $<$ Feature4 $\leq$ 0.348 | 1 | 0.9630 | 0.1383 | 0.2419 |

## Appendix B More Examples of Searched Rules

We provide the searched rules in Table 10 (Relation Extraction), Table 11(Log-based anomaly detection), Listing 1(Cooperative game) and Table 9 (Abuse detection).

**Table 10: Representative rule, precision, and description of relation extraction**
| Rule | Precision | Description |
| --- | --- | --- |
| player_of$\rightarrow$member_of | 1.0 | If someone is a player of a certain team, then they are also a member of that team. For example, “John is a player_of TeamA” can be deduced as “John is a member_of TeamA”. |
| minister_of$\rightarrow$agent_of | 0.9928 | If someone is a minister of a certain organization or country, then they are also an agent of that organization or country. For example, “Alice is a minister_of Country_X” can be deduced as “Alice is an agent_of Country_X”. |
| head_of_state-x, gpe0 $\rightarrow$ head_of_state | 0.7472 | If someone is the head of state of a nominal variation of a country, and that nominal variation corresponds to an official country name, then they are also the head of state of that country. For example, “PersonA is the head_of_state-x of German” and “German is gpe0 of Germany” can be deduced as “PersonA is the head_of_state of Germany”. |
| head_of_gov, in0-x $\rightarrow$ citizen_of-x | 0.8235 | If someone is the head of government of a country, and a geographic location in that country has a nominal variation, then the head of government can be considered a citizen of the nominal variation. For example, “PersonB is the head_of_gov of Israel” and “Tel Aviv is in0-x of Israeli” can be deduced as “PersonB is citizen_of-x of Israeli”. |
| head_of, agency_of $\rightarrow$ citizen_of | 0.6364 | If someone is the head of an organization, and that organization is an agency of a country, then the head of the organization can be considered a citizen of that country. For example, “PersonC is head_of Organization_Y” and “Organization_Y is agency_of Country_Z” can be deduced as “PersonC is citizen_of Country_Z”. |

Figure: Listing 1: Searched rules in Alice&Bob Scenario

**Table 11: Representative rule of Log-based anomaly detection**
| Rule | Precision | Description |
| --- | --- | --- |
| E7,E15 $\rightarrow$ abnormal | 1.0 | If events E11 and E28 occur sequentially, it indicates a high probability of anomaly with a confidence of 100%. |
| E11,E28 $\rightarrow$ abnormal | 0.9553 | If events E11 and E28 occur sequentially, it indicates a high probability of anomaly with a confidence of 95.53% |
| E11,E26,E20 $\rightarrow$ abnormal | 0.99 | If events E11 and E28 occur sequentially, it indicates a high probability of anomaly with a confidence of 99% |

## Appendix C Implementation Details

We provide detailed implementation for the three public tasks and the hyperparamter in Table 12.

### C.1 Relation Extraction

We employed Monte Carlo Tree Search (MCTS) for relation extraction across all relation triplets in the training set. The rules corresponding to terminal nodes were saved, and only those with a precision greater than 0.5 were retained, resulting in a final set of 20 rules. During decision-making, the LLMs select the most relevant rule based on similarity for each input. We experimented with both GPT-3.5 (gpt-35-turbo-16k-20230613) and GPT-4 (gpt-4-20230613).
For more hyper-parameters, please refer to Table 12.

Figure: Figure 5: Instruction prompt template for generating relation extraction triples.

### C.2 Log-based anomaly detection

For our experiments, we sampled 20,000 blocks of log sequences from the large HDFS dataset, which contained nearly 486,060 log entries. We split the dataset in a time-ordered fashion into training, validation, and test sets with a ratio of 8:1:1. Both the sequential and semantic information of log events were used for anomaly detection. In this task, we defined rules such that if a subset of events (e.g., $E_{m},E_{n},E_{l}\rightarrow abnormal$) appears in order in a sequence, it indicates an abnormal log sequence.
For example, the rule $E_{m},E_{n},E_{l}\rightarrow abnormal$ indicates that if $E_{m},E_{n},E_{l}$ appear in order within a sequence, the sequence is identified as having abnormal characteristics. We employed MCTS to search for rules in the log event sequences of the training set, with the rule’s accuracy serving as the reward. During anomaly detection, both event sequence and semantic information are input into the LLM, and matching rules are retrieved from the rule library. If no matching rule is found, the LLM is notified that the log sequence does not reflect any known abnormal patterns from historical data.

Figure: Figure 6: Instruction prompt template for Log-based anomaly detection

### C.3 Alice&Bob Scenario

We choose the cooperative puzzle-solving game Alice&Bob (shown in Figure 7), as it is both challenging in requiring planning and collaboration, where two agents, Alice and Bob, navigate a 13x9 grid to find a treasure (Chen et al., ) and the optimal path for them are both against to the intuition.
Each agent starts at different positions and can move up, down, left, right, or keep stand, constrained by walls and map boundaries. Keys open corresponding doors, and a lever removes walls, unlocking new areas. The agents only receive rewards upon reaching the treasure (+100), with penalties for hitting walls (-0.1 for general walls, -10 for removable ones). Each agent has limited visibility (a 3x3 area), and they must cooperate, using their abilities to overcome obstacles. Episodes last up to 50 steps.

Figure: Figure 7: Illustration of Alice& Bob.
Refer to caption: x5.png

The observation of the agents includes their surrounding 8 blocks, their relative distance to the treasure, their teammate’s relative distance to the treasure, as well as the special blocks they visited. The candidate body predicates, including the agents’ observations and their actions. We search the logic rules from different aspects following the LLMs’ suggestion: 1) team reward = -10; 2) Alice or Bob stand on yellow, purple, skyblue blocks; 3) Game Win.

Figure: Figure 8: Instruction prompt template for generating Alice’s action in Alice&Bob.

**Table 12: Summary of MCTS Parameters and LLM Configuration Across Tasks**
| Phase | Parameter | Relationship<br>Extraction | Anomaly<br>Detection | Abuse<br>Detection | Alice&Bob |
| --- | --- | --- | --- | --- | --- |
| Rule<br>Generation | Total rollouts | 500 | 500 | 500 | 500 |
|  | Reward metric | Precision | F1-score | F1-score | Precision + Recall |
|  | Maximum<br>body predicates | 2 | 5 | 5 | 10 |
|  | Terminal<br>condition | Precision $>$ 0.9 | Precision $>$ 0.9 | Precision $>$ 0.85 | Precision $=$ 1 |
| LLM<br>Reasoning | Maximum<br>tokens | 1000 | 1000 | 1000 | 1000 |
|  | Temperature | 0 | 0 | 0 | 0 |
|  | Top-p | 1 | 1 | 1 | 1 |
|  | Frequency<br>penalty | 0 | 0 | 0 | 0 |
|  | Presence<br>penalty | 0 | 0 | 0 | 0 |

## Peer Reviews

confidence: 4
contribution: 2
initial_rating: 5
presentation: 2
questions: 1. Did you use only the "train" split to construct the rules, testing them exclusively on the "test" split?
2. How did you partition the data for the cooperative game into train, validation, and test sets?
3. Given the reliance on deterministic predicates, how do you anticipate this approach adapting to real-world RAG scenarios requiring dynamic, knowledge-based decision-making?
soundness: 2
strengths: The paper contributes by integrating rule-based augmentation with generation models, leveraging rules learned from data.
summary: The paper presents a rule-augmented generation approach, where rules are learned from the training dataset using Monte Carlo Tree Search (MCTS).
It shows that leveraging rules can outperform retrieved passages or even other supervised trained models.
weaknesses: There are several areas of concern:

1. Clarity in Section 3.1 (LLM-based Logic Rule Search): This section is difficult to understand. Here are some follow-up questions for clarification:

    1.1. What do the initial predicates look like across the three different datasets?

    1.2. How does the LLM eliminate impossible predicates? Could you provide prompt examples?

    1.3. How does the LLM propose new target predicates? Any prompt examples for this?

2. Performance of Rules Alone: It appears that in cases where the rules generalize well to the test set, predictions might be straightforward using only the rules. However, this may not extend to more complex or varied test cases.

3. Applicability of Rules: The rules generated in this paper may not directly translate to real-world retrieval-augmented generation (RAG) settings, which often require "external knowledge" represented in both body and target predicates. For instance, the example in Figure 2 does not reflect how real-world decisions about weather predictions are made. The rules discussed here seem applicable primarily to scenarios with deterministic target predicates (e.g., classification tasks). How might this approach be extended to real-world scenarios, as suggested in the conclusion?

---

confidence: 3
contribution: 2
initial_rating: 5
presentation: 2
questions: ** Table 4 -- where do confidences come from?
soundness: 3
strengths: * The idea of using large language models for "feature extraction" is very interesting. It is related to https://arxiv.org/abs/2409.08466 (which I don't expect to be in the paper since it's very recent)

* The empirical results show that for some use cases abstract rules can be leveraged to improve performance.
summary: This paper proposes to use LLM to create abstract rules that can be provided in context for better decision making when using LLM. The method contains a few steps where first the LM is used to define the features and labels for which we would like to forumlate rules over. Then MCTS is used to find the rules that explain the data best, and last the rules are provided in-context for prediction. The idea of using LLM to create features to search over given data is very nice. The method is evaluated on tasks of relation extraction, anomaly detection and a multi-agent game. Using GPT-4 is much better than weaker models (unsurprisingly) and using the rules is better than some prior work termed HtT (which needs more explanation). In the game experiment there is advantage over ICL and RAG.
weaknesses: * The paper needs better **scoping** -- when is this method likely to be useful and when not? For example, the point of machine learning is that some things are hard to express by rules -- for example, what makes a face a face or a cat a cat? We learn machine learning models for cases where rules are hard to formulate. Is this method restricted to things that can be defined by rules or not? I think it's important to discuss this. Second - the method assumes an input of N features with some feature description. Often nowadays we work with more raw data like a sequence of words etc. Is this restricted to such cases? The tasks chosen are diverse but rare and it is not clear how general the method is and when we should expect it to work? Overall the generality of the method remains unclear and needs further discussion.

* Line 188: it is not clear if the LM looks at the actual data. The authors talk about using the LLM to look at the data and find patterns, but it seems maybe the LLM is only used to look at the schema, or the featuer descriptions to define what are the body and target predicates and it does not use the actual values of these features in the data at all? Choosing the rules is done with MCTS where it is not clear if the LM is used - it seems like rules are applied on the data to see if they work well. So if the LLM is not used to find patterns in the data this might be a bit limited.

* The paper has many clarity issues:
** Clarity - I don't understand figure 3 well enough - it seems important but is a mix of using text and emoji without proper explanation I can kind of squint at it and guess but it seems really difficult to understand what are the details of each step.

** Clarity: line 190: “initial the features as the body predicates” - what are the features exactly? can you give some examples and intuition at this point already?

** The paper talks about "impossible body predicates". What are those? Why are they impossible? What is exactly the input provided to the LLM to perform this task (please don't send me to the appendix in author response). Similarly "suggesting new target predicates" how? What is the task given to the LLM to do that? All those seem like crucial aspects that are not explained. I can imagine the LM doing an OK job in these things with some prompt but they don't seem necessarily like something that is well defined that even humans can do with reasonable agreement.

** HtT -- this seems like a key baseline that is not explained properly.

** Line 285: During the rule extraction process, we leveraged the LLM to filter out 15% of the relationships that were unlikely to serve as valid predicates. Unclear;

** Experimental details: There is very little detail in the paper on what are the featuers/labels/target and body predicates in each of the experiments, this makes it hard to understand the task. There are a few examples in a table but this is insufficient for understanding.

* Experimental evaluation: a lot of the comparisons in the experiment are between models that have very different abilities. Comparing GPT-4 to some CNN or BiLSTM or BERT is not a fair comparison at all. Baselines should be between the same model that uses different methods for providing in-context information and this is missing.

* Experimental evaluation: The main claim in the abstract and introduction is that using rules in context is a better alternative to in-context learning and RAG - but I don't see any RAG or ICL baselines in section 4.1 or section 4.2 so how can this claim be made? Did the author try ICL and RAG in 4.1 and 4.2? or only in 4.3? It would also be good to have much more detail on what the ICL and RAG baselines look like in Section 4.3.

* Minor: lines 189 and onwards have the same few sentences twice.

---

confidence: 3
contribution: 3
initial_rating: 8
presentation: 3
questions: 1. L190-195 probably has some copy-pasting errors?
soundness: 3
strengths: 1. RuAG offers a scalable solution for integrating extensive domain knowledge into LLMs that improves upon RAG or SFT.
2. Model performance is tested on a wide array of tasks and show improvement on strong baselines
3. RuAG is more computationally efficient than other methods that summarize external dataset as knowledge storage, as the calls to API models only happen once during logic rule constructions.
summary: This work introduces the RuAG framework that automatically distills large volumes of offline data into logical rules , which are then included in LLM prompts to enhance their reasoning capabilities.
weaknesses: 1. Ablation studies in Table 5 could include RAG or SFT on open-source LLMs, as the current baselines only include COT which does not include external knowledge.
2. How do LLMs suggest new rules to explore and detect impossible body predicates? These parts seem unclear to me.

Meta-review: The paper proposes a novel framework that distills offline data into logical rules using Monte Carlo Tree Search (MCTS), integrating these rules with LLMs to enhance reasoning across tasks. Strengths include its scalability, computational efficiency compared to methods like RAG, and its demonstrated effectiveness in diverse tasks (e.g., relation extraction, anomaly detection, and cooperative games). Reviewers appreciated its innovation in leveraging LLMs for rule-based reasoning and its empirical results showing improvement over baselines. However, weaknesses include unclear scoping on the method's generality, limited discussion on when rules are applicable, and insufficient clarity in some sections (e.g., predicate definitions, experimental details). The authors have conducted a satisfactory job on addressing these responses during the rebuttal. The paper has received borderline scores of 5,6,8, where the reviewer who gave 5 asked clarification questions and raised points on the inherent limitation of the method, such as the rule-based approach may be difficult to be applied in real-world tasks. This reviewer did not further participate in the discussion after the author responded. Personally I agree on this limitation but I think that is tolerable and the paper is interesting, thus I lean towards acceptance of this paper.

Decision: Accept (Poster)