slmjury 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slmjury-0.1.0/LICENSE +190 -0
- slmjury-0.1.0/PKG-INFO +334 -0
- slmjury-0.1.0/README.md +288 -0
- slmjury-0.1.0/pyproject.toml +99 -0
- slmjury-0.1.0/setup.cfg +4 -0
- slmjury-0.1.0/slmjury/__init__.py +55 -0
- slmjury-0.1.0/slmjury/configs/__init__.py +14 -0
- slmjury-0.1.0/slmjury/configs/models.yaml +192 -0
- slmjury-0.1.0/slmjury/core/__init__.py +1 -0
- slmjury-0.1.0/slmjury/core/evaluator.py +365 -0
- slmjury-0.1.0/slmjury/core/judge.py +290 -0
- slmjury-0.1.0/slmjury/core/scoring_evaluator.py +295 -0
- slmjury-0.1.0/slmjury/core/scoring_judge.py +376 -0
- slmjury-0.1.0/slmjury/core/solver.py +375 -0
- slmjury-0.1.0/slmjury/data/__init__.py +52 -0
- slmjury-0.1.0/slmjury/data/arc_challenge.py +61 -0
- slmjury-0.1.0/slmjury/data/arc_easy.py +61 -0
- slmjury-0.1.0/slmjury/data/gsm8k.py +62 -0
- slmjury-0.1.0/slmjury/data/gsm_plus.py +56 -0
- slmjury-0.1.0/slmjury/data/hellaswag.py +78 -0
- slmjury-0.1.0/slmjury/data/math.py +101 -0
- slmjury-0.1.0/slmjury/data/mtbench.py +72 -0
- slmjury-0.1.0/slmjury/data/summeval.py +91 -0
- slmjury-0.1.0/slmjury/data/truthfulqa.py +78 -0
- slmjury-0.1.0/slmjury/data/winogrande.py +72 -0
- slmjury-0.1.0/slmjury/parsers/__init__.py +22 -0
- slmjury-0.1.0/slmjury/parsers/answer.py +346 -0
- slmjury-0.1.0/slmjury/parsers/judgement.py +249 -0
- slmjury-0.1.0/slmjury/parsers/normalizer.py +351 -0
- slmjury-0.1.0/slmjury/parsers/score.py +227 -0
- slmjury-0.1.0/slmjury/py.typed +0 -0
- slmjury-0.1.0/slmjury/strategies/__init__.py +1 -0
- slmjury-0.1.0/slmjury/strategies/debate.py +637 -0
- slmjury-0.1.0/slmjury/strategies/ensemble.py +204 -0
- slmjury-0.1.0/slmjury/strategies/persona.py +174 -0
- slmjury-0.1.0/slmjury/utils/__init__.py +1 -0
- slmjury-0.1.0/slmjury.egg-info/PKG-INFO +334 -0
- slmjury-0.1.0/slmjury.egg-info/SOURCES.txt +39 -0
- slmjury-0.1.0/slmjury.egg-info/dependency_links.txt +1 -0
- slmjury-0.1.0/slmjury.egg-info/requires.txt +22 -0
- slmjury-0.1.0/slmjury.egg-info/top_level.txt +1 -0
slmjury-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to the Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by the Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding any notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2025-2026 Anish Laddha, Nitesh Pradhan, Gaurav Srivastava
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|
slmjury-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: slmjury
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: SLMJury: Can Small Language Models Judge as Well as Large Language Models?
|
|
5
|
+
Author-email: Anish Laddha <anshladdha15@gmail.com>, Nitesh Pradhan <nitesh.pradhan@lnmiit.ac.in>, Gaurav Srivastava <gks@vt.edu>
|
|
6
|
+
Maintainer-email: Anish Laddha <anshladdha15@gmail.com>
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Homepage, https://github.com/anishh15/SLMJury
|
|
9
|
+
Project-URL: Repository, https://github.com/anishh15/SLMJury
|
|
10
|
+
Project-URL: Bug Tracker, https://github.com/anishh15/SLMJury/issues
|
|
11
|
+
Project-URL: Leaderboard, https://anishh15.github.io/SLMJury/
|
|
12
|
+
Keywords: slm,llm,judge,evaluation,reasoning,nlp,small-language-models,multi-agent-debate,majority-voting
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Requires-Dist: torch>=2.0.0
|
|
28
|
+
Requires-Dist: transformers>=4.40.0
|
|
29
|
+
Requires-Dist: datasets>=2.19.0
|
|
30
|
+
Requires-Dist: numpy>=1.26.0
|
|
31
|
+
Requires-Dist: pandas>=2.2.0
|
|
32
|
+
Requires-Dist: sympy>=1.12
|
|
33
|
+
Requires-Dist: pyyaml>=6.0
|
|
34
|
+
Requires-Dist: tqdm>=4.66.0
|
|
35
|
+
Provides-Extra: vllm
|
|
36
|
+
Requires-Dist: vllm>=0.4.0; extra == "vllm"
|
|
37
|
+
Provides-Extra: together
|
|
38
|
+
Requires-Dist: together>=1.0.0; extra == "together"
|
|
39
|
+
Provides-Extra: dev
|
|
40
|
+
Requires-Dist: pytest>=8.0.0; extra == "dev"
|
|
41
|
+
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
|
|
42
|
+
Requires-Dist: ruff>=0.4.0; extra == "dev"
|
|
43
|
+
Provides-Extra: full
|
|
44
|
+
Requires-Dist: slmjury[dev,together,vllm]; extra == "full"
|
|
45
|
+
Dynamic: license-file
|
|
46
|
+
|
|
47
|
+
<p align="center">
|
|
48
|
+
<img src="assets/banner.svg" alt="SLMJury Banner" width="100%">
|
|
49
|
+
</p>
|
|
50
|
+
|
|
51
|
+
<div align="center">
|
|
52
|
+
|
|
53
|
+
<!-- Badges -->
|
|
54
|
+
<a href="#-installation"><img src="https://img.shields.io/badge/📦_PyPI-Coming_Soon-lightgrey?style=for-the-badge&logo=pypi&logoColor=white" alt="PyPI"/></a>
|
|
55
|
+
<a href="#-citation"><img src="https://img.shields.io/badge/📄_Paper-Coming_Soon-lightgrey?style=for-the-badge&logo=arxiv" alt="Paper"/></a>
|
|
56
|
+
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10+-blue.svg?style=for-the-badge&logo=python&logoColor=white" alt="Python"/></a>
|
|
57
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/License-Apache_2.0-green.svg?style=for-the-badge" alt="License"/></a>
|
|
58
|
+
<a href="https://github.com/anishh15/SLMJury/stargazers"><img src="https://img.shields.io/github/stars/anishh15/SLMJury?style=for-the-badge&logo=github&color=yellow" alt="Stars"/></a>
|
|
59
|
+
|
|
60
|
+
*Can Small Language Models Judge as Well as Large Language Models?*
|
|
61
|
+
|
|
62
|
+
**🧑⚖️ 16 SLM Judges • 📊 10 Datasets • 🗳️ 3 Advanced Strategies • 🎭 6 Persona Prompts**
|
|
63
|
+
|
|
64
|
+
[**🏆 Leaderboard**](https://anishh15.github.io/SLMJury/) | [**🚀 Get Started**](#-installation)
|
|
65
|
+
|
|
66
|
+
</div>
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## 💡 What is SLMJury?
|
|
71
|
+
|
|
72
|
+
SLMJury is a comprehensive framework that investigates whether **Small Language Models (0.6B–14B parameters)** can serve as reliable judges across both **closed-ended** (accuracy-based) and **open-ended** (correlation-based) evaluation paradigms. The project explores six evaluation modes: individual judging, persona-based evaluation, majority-vote ensembles, multi-agent debate, human agreement scoring (SummEval), and LLM agreement scoring (MT-Bench).
|
|
73
|
+
|
|
74
|
+
<div align="center">
|
|
75
|
+
<a href="https://anishh15.github.io/SLMJury/">
|
|
76
|
+
<img src="https://img.shields.io/badge/🎯_Visit_Leaderboard-Live_Demo-brightgreen?style=for-the-badge&logo=rocket" alt="Visit Leaderboard">
|
|
77
|
+
</a>
|
|
78
|
+
</div>
|
|
79
|
+
|
|
80
|
+
### 🌟 Key Highlights
|
|
81
|
+
|
|
82
|
+
<table>
|
|
83
|
+
<tr>
|
|
84
|
+
<td width="33%">
|
|
85
|
+
|
|
86
|
+
#### 🧠 **Individual Judging**
|
|
87
|
+
- 16 SLM judges from 4 model families
|
|
88
|
+
- Quick verdict vs. reasoned response
|
|
89
|
+
- Accuracy & Instruction Following Rate
|
|
90
|
+
|
|
91
|
+
</td>
|
|
92
|
+
<td width="33%">
|
|
93
|
+
|
|
94
|
+
#### 🗳️ **Majority Voting**
|
|
95
|
+
- C(5,3) ensemble combinations
|
|
96
|
+
- Top-5 best individual judges
|
|
97
|
+
- Boosted accuracy via consensus
|
|
98
|
+
|
|
99
|
+
</td>
|
|
100
|
+
<td width="33%">
|
|
101
|
+
|
|
102
|
+
#### 🤝 **Multi-Agent Debate**
|
|
103
|
+
- RCR (Reflect-Critique-Refine) prompting
|
|
104
|
+
- Cross-architecture & same-model variants
|
|
105
|
+
- Up to 5 rounds with consensus fallback
|
|
106
|
+
|
|
107
|
+
</td>
|
|
108
|
+
</tr>
|
|
109
|
+
</table>
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## ⚡ Installation
|
|
114
|
+
|
|
115
|
+
### 🔧 From Source (Recommended)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
git clone https://github.com/anishh15/SLMJury.git
|
|
119
|
+
cd SLMJury
|
|
120
|
+
pip install -e .
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## 🚀 Quick Start
|
|
126
|
+
|
|
127
|
+
### 💻 CLI Scripts
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# Step 1: Run student model inference
|
|
131
|
+
python scripts/run_student.py --model qwen2.5-32b --datasets gsm8k math
|
|
132
|
+
|
|
133
|
+
# Step 2: Run judge evaluations
|
|
134
|
+
python scripts/run_judge.py --judge qwen3-4b --max-tokens 10 8192
|
|
135
|
+
|
|
136
|
+
# Step 3: Evaluate all judgements and generate summaries
|
|
137
|
+
python scripts/run_evaluation.py
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
### 🐍 Python API
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
from slmjury.core.solver import StudentSolver
|
|
144
|
+
from slmjury.core.judge import JudgeModel
|
|
145
|
+
from slmjury.core.evaluator import JudgeEvaluator
|
|
146
|
+
|
|
147
|
+
# Step 1: Solve problems with a student model
|
|
148
|
+
solver = StudentSolver("qwen2.5-32b")
|
|
149
|
+
results = solver.solve_batch(problems, "gsm8k")
|
|
150
|
+
solver.save_results(results, "gsm8k")
|
|
151
|
+
solver.cleanup()
|
|
152
|
+
|
|
153
|
+
# Step 2: Judge the solutions
|
|
154
|
+
judge = JudgeModel("qwen3-4b")
|
|
155
|
+
judgements = judge.evaluate_batch(results, max_tokens=10)
|
|
156
|
+
judge.save_results(judgements, "qwen2.5-32b", "gsm8k", 10)
|
|
157
|
+
judge.cleanup()
|
|
158
|
+
|
|
159
|
+
# Step 3: Evaluate judge accuracy
|
|
160
|
+
evaluator = JudgeEvaluator("qwen3-4b", "qwen2.5-32b", "gsm8k", 10, judgements)
|
|
161
|
+
summary = evaluator.evaluate()
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
<details>
|
|
165
|
+
<summary><b>🧩 Advanced: Multi-Agent Strategies</b></summary>
|
|
166
|
+
|
|
167
|
+
```python
|
|
168
|
+
# Majority voting ensemble
|
|
169
|
+
from slmjury.strategies.ensemble import run_majority_voting
|
|
170
|
+
run_majority_voting(
|
|
171
|
+
judge_keys=["qwen3-4b", "phi4mi-3.8b", "qwen2.5-3b"],
|
|
172
|
+
student_results=results,
|
|
173
|
+
max_tokens=10,
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
# Multi-agent debate (3 judges, RCR prompting)
|
|
177
|
+
from slmjury.strategies.debate import run_debate
|
|
178
|
+
run_debate(
|
|
179
|
+
combo_models=["qwen3-4b", "phi4mi-3.8b", "qwen2.5-3b"],
|
|
180
|
+
combo_temps=[0, 0, 0],
|
|
181
|
+
student_results=results,
|
|
182
|
+
dataset_name="gsm8k",
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
# Persona effects (6 system prompts × all judges)
|
|
186
|
+
from slmjury.strategies.persona import run_persona_evaluation
|
|
187
|
+
run_persona_evaluation("qwen3-4b", results, max_tokens=10)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
</details>
|
|
191
|
+
|
|
192
|
+
<details>
|
|
193
|
+
<summary><b>🔬 Open-Ended Scoring (SummEval / MT-Bench)</b></summary>
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# Score SummEval with a single judge
|
|
197
|
+
python scripts/run_scoring_judge.py \
|
|
198
|
+
--judge qwen3-4b --dataset summeval
|
|
199
|
+
|
|
200
|
+
# Score MT-Bench with a single judge
|
|
201
|
+
python scripts/run_scoring_judge.py \
|
|
202
|
+
--judge qwen3-4b --dataset mtbench \
|
|
203
|
+
--oracle-scores results/mtbench_oracle/
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
```python
|
|
207
|
+
from slmjury.core.scoring_judge import ScoringJudge
|
|
208
|
+
|
|
209
|
+
judge = ScoringJudge("qwen3-4b", output_dir="results/scoring")
|
|
210
|
+
|
|
211
|
+
# Score SummEval (4-dimension scoring)
|
|
212
|
+
summeval_data = load_dataset("summeval")
|
|
213
|
+
results = judge.score_summeval(summeval_data, max_tokens=8192)
|
|
214
|
+
judge.save_results(results, "summeval")
|
|
215
|
+
judge.cleanup()
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
</details>
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## 🤖 Supported Models
|
|
223
|
+
|
|
224
|
+
<table>
|
|
225
|
+
<thead>
|
|
226
|
+
<tr>
|
|
227
|
+
<th align="left">Family</th>
|
|
228
|
+
<th align="left">Models</th>
|
|
229
|
+
<th align="center">Parameters</th>
|
|
230
|
+
<th align="center">Thinking</th>
|
|
231
|
+
</tr>
|
|
232
|
+
</thead>
|
|
233
|
+
<tbody>
|
|
234
|
+
<tr><td><b>Qwen 2.5</b></td><td>1.5B, 3B, 7B</td><td align="center">1.5B – 7B</td><td align="center">—</td></tr>
|
|
235
|
+
<tr><td><b>Qwen 3</b></td><td>0.6B, 1.7B, 4B, 8B, 14B</td><td align="center">0.6B – 14B</td><td align="center">✅</td></tr>
|
|
236
|
+
<tr><td><b>Llama 3.x</b></td><td>3.2-1B, 3.2-3B, 3.1-8B</td><td align="center">1B – 8B</td><td align="center">—</td></tr>
|
|
237
|
+
<tr><td><b>Phi-4</b></td><td>14B, Reasoning, R-Plus, Mini, Mini-Reasoning</td><td align="center">3.8B – 14B</td><td align="center">✅*</td></tr>
|
|
238
|
+
</tbody>
|
|
239
|
+
</table>
|
|
240
|
+
|
|
241
|
+
<sub>*Phi-4 Reasoning/Plus/Mini-Reasoning always use thinking mode and skip quick verdict (t=10) evaluation.</sub>
|
|
242
|
+
|
|
243
|
+
### 📊 Datasets
|
|
244
|
+
|
|
245
|
+
**Closed-ended** (verdict: Correct/Incorrect):
|
|
246
|
+
|
|
247
|
+
| Dataset | Type | Domain | Size |
|
|
248
|
+
|---------|------|--------|------|
|
|
249
|
+
| **GSM8K** | Numeric | Math | 1,319 |
|
|
250
|
+
| **GSM-Plus** | Numeric | Math | 10,552 |
|
|
251
|
+
| **MATH** | LaTeX | Math | 5,000 |
|
|
252
|
+
| **ARC-Easy** | Multiple Choice | Science | 2,376 |
|
|
253
|
+
| **ARC-Challenge** | Multiple Choice | Science | 1,172 |
|
|
254
|
+
| **HellaSwag** | Multiple Choice | General | 10,042 |
|
|
255
|
+
| **WinoGrande** | Multiple Choice | General | 1,267 |
|
|
256
|
+
| **TruthfulQA** | Multiple Choice | General | 684 |
|
|
257
|
+
|
|
258
|
+
**Open-ended** (scoring: 1–5):
|
|
259
|
+
|
|
260
|
+
| Dataset | Type | Turns | Size | Oracle |
|
|
261
|
+
|---------|------|-------|------|--------|
|
|
262
|
+
| **SummEval** | Summarization | — | 1,600 pairs | Human annotations |
|
|
263
|
+
| **MT-Bench** | Multi-turn chat | 2 | 80 questions | GPT-OSS-120B, Qwen3.5-397B (Together API) |
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 🏗️ Project Structure
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
SLMJury/
|
|
271
|
+
├── slmjury/ # Python package
|
|
272
|
+
│ ├── configs/ # Centralized YAML model configurations
|
|
273
|
+
│ ├── data/ # Dataset loaders (HuggingFace → local JSON)
|
|
274
|
+
│ ├── parsers/ # Answer extraction, normalization, verdict/score parsing
|
|
275
|
+
│ ├── core/ # Pipeline: solver → judge → evaluator + scoring
|
|
276
|
+
│ └── strategies/ # Ensemble voting, multi-agent debate, personas
|
|
277
|
+
├── scripts/ # CLI entry-points (student, judge, oracle, scoring)
|
|
278
|
+
├── bash/ # Bash wrappers for full experiment runs
|
|
279
|
+
├── tests/ # Unit & integration tests (pytest)
|
|
280
|
+
├── website/ # React leaderboard (Vite + Tailwind)
|
|
281
|
+
├── assets/ # SVG banner and logo
|
|
282
|
+
├── pyproject.toml # Package config (pip install -e .)
|
|
283
|
+
└── README.md
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
---
|
|
287
|
+
|
|
288
|
+
## 🏆 Leaderboard
|
|
289
|
+
|
|
290
|
+
Explore full results on the interactive leaderboard:
|
|
291
|
+
|
|
292
|
+
<div align="center">
|
|
293
|
+
<a href="https://anishh15.github.io/SLMJury/">
|
|
294
|
+
<img src="https://img.shields.io/badge/🏆_Explore_Leaderboard-Visit_Now-brightgreen?style=for-the-badge&logo=rocket" alt="Visit Leaderboard">
|
|
295
|
+
</a>
|
|
296
|
+
</div>
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## 📖 Citation
|
|
301
|
+
|
|
302
|
+
If you use SLMJury in your research, please cite:
|
|
303
|
+
|
|
304
|
+
```bibtex
|
|
305
|
+
@misc{laddha2026slmjury,
|
|
306
|
+
title={SLMJury: Can Small Language Models Judge as Well as Large Language Models?},
|
|
307
|
+
author={Anish Laddha and Nitesh Pradhan and Gaurav Srivastava},
|
|
308
|
+
year={2026},
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
## 📄 License
|
|
315
|
+
|
|
316
|
+
Apache License 2.0 — see [LICENSE](LICENSE) for details.
|
|
317
|
+
|
|
318
|
+
---
|
|
319
|
+
|
|
320
|
+
<div align="center">
|
|
321
|
+
|
|
322
|
+
<a href="#-installation"><img src="https://img.shields.io/badge/🚀_Get_Started-FF6B6B?style=for-the-badge" alt="Get Started"/></a>
|
|
323
|
+
<a href="https://anishh15.github.io/SLMJury/"><img src="https://img.shields.io/badge/🏆_Leaderboard-4ECDC4?style=for-the-badge" alt="Leaderboard"/></a>
|
|
324
|
+
<a href="https://github.com/anishh15/SLMJury"><img src="https://img.shields.io/badge/⭐_Star_on_GitHub-yellow?style=for-the-badge" alt="GitHub"/></a>
|
|
325
|
+
|
|
326
|
+
**Made with ❤️ by [Anish Laddha](https://github.com/anishh15), [Nitesh Pradhan](https://github.com), and [Gaurav Srivastava](https://github.com/ctrl-gaurav)**
|
|
327
|
+
|
|
328
|
+
</div>
|
|
329
|
+
|
|
330
|
+
<p align="center">
|
|
331
|
+
<a href="https://github.com/anishh15/SLMJury">
|
|
332
|
+
<img src="assets/logo.svg" alt="SLMJury Logo" width="100">
|
|
333
|
+
</a>
|
|
334
|
+
</p>
|