HORNET-RAG: A Hybrid Retrieval-Augmented Generation Framework Integrating Horn Clause Reasoning for Treaty Question Answering
Abstract
The increasing use of large language models (LLMs) in legal question answering is constrained by hallucinations, unsupported statements, and the inability of conventional Retrieval-Augmented Generation (RAG) to capture the normative and logical relationships embedded in legal documents. This study aims to improve retrieval and answer reliability by introducing HORNET-RAG, a neuro-symbolic RAG framework that integrates dense semantic retrieval with Horn Clause reasoning for treaty question answering. The core idea and contribution are to operationalize Horn Clause inference as a candidate-level retrieval-control mechanism through logical filtering and logic-aware reranking, rather than using symbolic reasoning only as a downstream inference process. The framework was evaluated using 120 treaty documents containing 4,862 retrieval units and 250 legal queries, divided into 50 development and 200 held-out test queries. Experimental findings show that HORNET-RAG Filtering achieved the highest precision, with P@3 = 0.84 and P@5 = 0.78, representing improvements of 33.3% and 32.2%, respectively, over Naïve RAG. HORNET-RAG Reranking achieved P@3 = 0.81, R@3 = 0.88, and the highest nDCG@3 = 0.90, improving nDCG@3 by 25.0% over Naïve RAG. For answer quality, reranking achieved the highest Faithfulness score of 0.90, compared with 0.72 for Naïve RAG and 0.83 for Prolog-RAG, while filtering achieved the highest Context Precision of 0.84. Statistical validation confirmed significant improvements, including ΔP@3 = +0.210 for filtering and ΔnDCG@3 = +0.180 for reranking versus Naïve RAG (both adjusted p < 0.001). The novelty of HORNET-RAG lies in moving Horn Clause reasoning into candidate selection and ranking, enabling logical evidence to directly shape the context supplied to the LLM and improving precision, ranking quality, and evidence-grounded answer generation.
Keywords
Full Text:
PDFReferences
D. M. Katz, M. J. Bommarito, S. Gao, and P. Arredondo, “GPT-4 passes the bar exam,” Philosophical Transactions of the Royal Society A: Mathematical, Physical and Engineering Sciences, vol. 382, no. 2207, Apr. 2024. [Online]. Available: https://doi.org/10.1098/rsta.2023.0254
A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A.N. Gomez, et. al., “Attention is all you need,” Proceedings of the 31st International Conference on Neural Information Processing Systems, pp. 6000–6010, 2017. [Online]. Available: https://doi.org/10.5555/3295222.3295349
S. Yao, Q. Ke, Q. Wang, K. Li, and J. Hu., “Lawyer GPT: A legal large language model with enhanced domain knowledge and reasoning capabilities,” Proceedings of the 2024 3rd International Symposium on Robotics, Artificial Intelligence and Information Engineering (RAIIE), pp. 108–112, 2024. [Online]. Available: https://doi.org/10.1145/3689299.3689319
J. Cui,M. Ning,Z. Li,H. Li,Y. Ya,B. Chen, et al., “Chatlaw: A multi-agent collaborative legal assistant with knowledge graph-enhanced mixture-of-experts large language model,” Fundamental Research, 2024. [Online]. Available: https://doi.org/10.1016/j.fmre.2026.03.026
A. Aidid, “Toward an ethical human-computer division of labor in law practice,” Fordham Law Review, vol. 92, no. 5, Mar. 2024.[Online]. Available: https://doi.org/10.2139/ssrn.5262645
M. Kant, S. Nabi, M. Kant, R. Scharrer, M. Ma, and M. Nabi, “Towards robust legal reasoning: Harnessing logical LLMs in law,” arXiv preprint, Feb. 2025. [Online]. Available: https://doi.org/10.48550/arXiv.2502.17638
P. Schramowski, C. Turan, N. Andersen, C. A. Rothkopf, and K. Kersting, “Large pre-trained language models contain human-like biases of what is right and wrong to do,” Nature Machine Intelligence, vol. 4, pp. 258–268, Mar. 2022. [Online]. Available: https://doi.org/10.1038/s42256-022-00458-8.
P.Lewis, E. Perez, A. Piktus, F. Petroni, V. Karpukhin, N. Goyal, et. al., “Retrieval-augmented generation for knowledge-intensive NLP tasks,” Proceedings of the 34th International Conference on Neural Information Processing Systems, no. 793, Dec. 2020. [Online]. Available: https://doi.org/abs/10.5555/3495724.3496517
A. V. Kozhipuram, S. Shailendra, and R. Kadel, “Retrieval-augmented generation vs. baseline LLMs: A multi-metric evaluation for knowledge-intensive content,” Information, vol. 16, no. 9, p. 766, Sep. 2025. [Online]. Available: https://doi.org/10.3390/info16090766.
G. Izacard, P. Lewis, M. Lomeli, L. Hosseini, F.Petroni, T. Schick, et. al., “Atlas: Few-shot learning with retrieval-augmented language models,” Journal of Machine Learning Research, vol. 24, no. 251, pp. 1–43, Jan. 2023.[Online]. Available: https://doi.org/10.5555/3648699.3648950
H. T. Nguyen, W. Fungwacharakorn, M. M. Zin, R. Goebel, F. Toni, K. Stathis, et al., “LLMs for legal reasoning: A unified framework and future perspectives,” Computer Law & Security Review, vol. 58, p. 106165, Sep. 2025. [Online]. Available: https://doi.org/10.1016/j.clsr.2025.106165
R. J. Brachman and H. J. Levesque, “Knowledge Representation and Reasoning,” Morgan Kaufmann, 2004, pp. 85-73. . [Online]. Available: https://books.google.co.id/books?id=OuPtLaA5QjoC
A. S. d’Avila Garcez, L. C. Lamb, and D. M. Gabbay, “Neural-Symbolic Cognitive Reasoning,” New York: Springer, 2009. [Online]. Available: https://books.google.co.id/books?id=M7bYqAPqdyAC
Z. J. Baum, X. Yu, P. Y. Ayala, Y. Zhao, S. P. Watkins, and Q. Zhou, “Artificial intelligence in chemistry: Current trends and future directions,” Journal of Chemical Information and Modeling, vol. 61, no. 7, pp. 3197–3212, Jul. 2021. [Online]. Available: https://doi.org/10.1021/acs.jcim.1c00619
J. Wei, X. Wang, D. Schuurmans, M. Bosma, B. Ichter, F. Xia, et. al, “Chain-of-thought prompting elicits reasoning in large language models,” Proceedings of the 36th International Conference on Neural Information Processing Systems (NeurIPS), 2022, pp. 24824–24837. [Online]. Available: https://dl.acm.org/doi/10.5555/3600270.3602070
M. Shanahan, “Talking about large language models,” Communications of the ACM, vol. 67, no. 2, pp. 68–79, Feb. 2024, . [Online]. Available: https://doi.org/10.1145/3624724.
L. Pan, A. Albalak, X. Wang, and W. Wang, “Logic-LM: Empowering large language models with symbolic solvers for faithful logical reasoning,” Findings of the Association for Computational Linguistics, pp. 3806–3824, Dec. 2023. [Online]. Available: https://doi.org/10.18653/v1/2023.findings-emnlp.248
S. Kirtania, P. Gupta, and A. Radhakrishna, “LOGIC-LM++: Multi-step refinement for symbolic formulations,” Proceedings of the ACL Workshop on Natural Language Reasoning and Structured Explanations, pp. 56–63. Aug. 2024. [Online]. Available: https://doi.org/10.18653/v1/2024.nlrse-1.6.
P. Vakharia, A. Kufeldt, M. Meyers, I. Lane, and L. H. Gilpin, “ProSLM: A Prolog-synergized language model for explainable domain-specific knowledge-based question answering,” Neural-Symbolic Learning and Reasoning: Proceedings of the 18th International Conference, pp. 291–304, Sep. 2024. [Online]. Available: https://dl.acm.org/doi/10.1007/978-3-031-71170-1_23
T. Olausson, A. Gu, B. Lipkin, C. Zhang, A. Solar-Lezama, J. Tenenbaum, et. al., “LINC: A neurosymbolic approach for logical reasoning by combining language models with first-order logic provers,” Proceedings of the Conference on Empirical Methods in Natural Language Processing, pp.5153–5176. Dec. 2023. [Online]. Available: https://doi.org/10.18653/v1/2023.emnlp-main.313
S. Yao, D. Yu, J. Zhao, I. Shafran, T. L. Griffiths, Y. Cao, et al., “Tree of thoughts: Deliberate problem solving with large language models,” Proceedings of the 37th International Conference on Neural Information Processing Systems, no. 517, pp. 11809-11822, Dec. 2023. [Online]. Available: https://dl.acm.org/doi/abs/10.5555/3666122.3666639
B. Zhang, J. Li, K. Peng, S. Zheng, and K. Meng, “Prolog-RAG: A symbolic reasoning approach to retrieval-augmented generation,” Proceedings of the 6th International Conference on Computer Engineering and Application, pp. 1814–1819., Apr. 2025. [Online]. Available: https://doi.org/10.1109/ICCEA65460.2025.11103126
B. Liu, Y. Hu, Q. Ai, Y. Liu, Y. Wu, C. Li, and W. Shen, “Leveraging event schema to ask clarifying questions for conversational legal case retrieval,” Proceedings of the 32nd ACM International Conference on Information and Knowledge Management, pp. 1513–1522, Oct. 2023. [Online]. Available: https://doi.org/10.1145/3583780.3614953
D. Llewelyn and M. Tehan, “ ‘Treaties,’ ‘agreements,’ ‘contracts,’ and ‘commitments’: What’s in a name? The legal force and meaning of different forms of agreement making,” Melbourne Legal Studies Research Paper, no. 7, pp. 6–40, Oct. 2005. [Online]. Available: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=815324
S. Es, J. James, L. Espinosa Anke, and S. Schockaert, “RAGAs: Automated evaluation of retrieval augmented generation,” Proceedings of the 18th Conference of the European Chapter of the Association for Computational Linguistics: System Demonstrations, pp. 150–158, March 2024. [Online]. ]. Available: https://doi.org/10.18653/v1/2024.eacl-demo.16
DOI: https://doi.org/10.47738/jads.v7i4.1590
Refbacks
- There are currently no refbacks.

Journal of Applied Data Sciences
| ISSN | : | 2723-6471 (Online) |
| Publisher | : | Bright Publisher |
| Website | : | http://bright-journal.org/JADS |
| : | taqwa@amikompurwokerto.ac.id (principal contact) | |
| support@bright-journal.org (technical issues) |
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0




.png)