Skip to content

Commit 7201832

Browse files
committed
[Move DISCO queue to core]: Update docs to reflect MMLU, scorer, and queue changes
- Add missing documentation for new core components introduced alongside the MMLU benchmark: ModelScorer reference page, InformativeSubsetQueue/DISCOQueue in task reference, get_with_assert in exceptions reference, and HuggingFacePipelineModelAdapter rename in model/HuggingFace pages. - Add mmlu extra to README install section. - Fix grammar in MMLU docs and fill CHANGELOG PR placeholders.
1 parent afd2cf9 commit 7201832

9 files changed

Lines changed: 67 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4141

4242
**Core**
4343

44-
- Added `DISCOQueue` to `maseval.core.task` for subset-based evaluation (e.g., anchor-point selection for DISCO). Available via `from maseval import DISCOQueue`. (PR: #34)
45-
- Added `ModelScorer` abstract base class in `maseval.core.scorer` for log-likelihood scoring, with `loglikelihood()`, `loglikelihood_batch()`, and `loglikelihood_choices()` methods. (PR: #PR_NUMBER_PLACEHOLDER)
44+
- Added `InformativeSubsetQueue` and `DISCOQueue` to `maseval.core.task` for subset-based evaluation (e.g., anchor-point selection for DISCO). `DISCOQueue` accepts `anchor_points_path` to load indices from a `.json`/`.pkl` file via `DISCOQueue.load_anchor_points()`. Available via `from maseval import DISCOQueue, InformativeSubsetQueue`. (PR: #34)
45+
- Added `get_with_assert()` utility in `maseval.core.exceptions` for strict dictionary access that raises `KeyError` instead of silently returning a default. Supports nested key lookups. (PR: #34)
46+
- Added `ModelScorer` abstract base class in `maseval.core.scorer` for log-likelihood scoring, with `loglikelihood()`, `loglikelihood_batch()`, and `loglikelihood_choices()` methods. (PR: #34)
4647
- Added `SeedGenerator` abstract base class and `DefaultSeedGenerator` implementation for reproducible benchmark runs via SHA-256-based seed derivation (PR: #24)
4748
- Added `seed` and `seed_generator` parameters to `Benchmark.__init__` for enabling reproducibility (PR: #24)
4849
- Added `seed_generator` parameter to all benchmark setup methods (`setup_environment`, `setup_user`, `setup_agents`, `setup_evaluators`) (PR: #24)
@@ -53,8 +54,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
5354

5455
**Interface**
5556

56-
- Added `HuggingFaceModelScorer` in `maseval.interface.inference` — log-likelihood scorer backed by a HuggingFace `AutoModelForCausalLM`, with single-token optimisation for MCQ evaluation. Implements the `ModelScorer` interface. (PR: #PR_NUMBER_PLACEHOLDER)
57-
- Renamed `HuggingFaceModelAdapter``HuggingFacePipelineModelAdapter` to distinguish it from the new scorer. The old name remains as a backwards-compatible alias. (PR: #PR_NUMBER_PLACEHOLDER)
57+
- Added `HuggingFaceModelScorer` in `maseval.interface.inference` — log-likelihood scorer backed by a HuggingFace `AutoModelForCausalLM`, with single-token optimisation for MCQ evaluation. Implements the `ModelScorer` interface. (PR: #34)
58+
- Renamed `HuggingFaceModelAdapter``HuggingFacePipelineModelAdapter` to distinguish it from the new scorer. The old name remains as a backwards-compatible alias. (PR: #34)
5859

5960
- CAMEL-AI integration: `CamelAgentAdapter` and `CamelLLMUser` for evaluating CAMEL-AI ChatAgent-based systems (PR: #22)
6061
- Added `CamelAgentUser` for using a CAMEL ChatAgent as the user in agent-to-agent evaluation (PR: #22)

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,13 @@ pip install "maseval[langgraph]"
109109
pip install "maseval[llamaindex]"
110110
```
111111

112+
Or install benchmark-specific dependencies:
113+
114+
```bash
115+
# MMLU (HuggingFace models)
116+
pip install "maseval[mmlu]"
117+
```
118+
112119
## Example
113120

114121
Examples are available in the [Documentation](https://maseval.readthedocs.io/en/stable/).

docs/benchmark/mmlu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ tasks = load_tasks(
8888
anchor_points_path="/path/to/anchor_points.json",
8989
)
9090

91-
# tasks is an DISCOQueue — only anchor tasks are evaluated
91+
# tasks is a DISCOQueue — only anchor tasks are evaluated
9292
print(f"Evaluating {len(tasks)} anchor tasks")
9393
```
9494

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1-
# HuggingFace Inference Adapter
1+
# HuggingFace Inference Adapters
22

3-
This page documents the HuggingFace model adapter for MASEval.
3+
This page documents the HuggingFace model adapters for MASEval.
4+
5+
## Pipeline Model Adapter (Text Generation)
46

57
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/interface/inference/huggingface.py){ .md-source-file }
68

7-
::: maseval.interface.inference.huggingface.HuggingFaceModelAdapter
9+
::: maseval.interface.inference.huggingface.HuggingFacePipelineModelAdapter
10+
11+
!!! note
12+
`HuggingFaceModelAdapter` is a backwards-compatible alias for `HuggingFacePipelineModelAdapter`.
13+
14+
## Model Scorer (Log-Likelihood)
15+
16+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/interface/inference/huggingface_scorer.py){ .md-source-file }
17+
18+
::: maseval.interface.inference.huggingface_scorer.HuggingFaceModelScorer

docs/reference/exceptions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ SimulatorError (base for simulators)
3838

3939
::: maseval.core.simulator.UserSimulatorError
4040

41+
## Data Access Helpers
42+
43+
::: maseval.core.exceptions.get_with_assert
44+
4145
## Validation Helpers
4246

4347
These functions simplify input validation and raise `AgentError` with helpful suggestions:

docs/reference/model.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The following adapter classes implement the ModelAdapter interface for specific
2020

2121
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/interface/inference/huggingface.py){ .md-source-file }
2222

23-
::: maseval.interface.inference.huggingface.HuggingFaceModelAdapter
23+
::: maseval.interface.inference.huggingface.HuggingFacePipelineModelAdapter
2424

2525
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/interface/inference/google_genai.py){ .md-source-file }
2626

docs/reference/scorer.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Model Scorers
2+
3+
Model Scorers provide a uniform interface for log-likelihood computation across model providers. Unlike `ModelAdapter` (which handles text generation and chat), scorers evaluate how likely a model considers a given continuation given some context.
4+
5+
!!! note
6+
7+
`ModelScorer` is the scoring counterpart to `ModelAdapter`. Use it when you need log-likelihood evaluation (e.g., multiple-choice benchmarks) rather than text generation.
8+
9+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/scorer.py){ .md-source-file }
10+
11+
::: maseval.core.scorer.ModelScorer
12+
13+
## Interfaces
14+
15+
The following scorer classes implement the ModelScorer interface for specific providers.
16+
17+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/interface/inference/huggingface_scorer.py){ .md-source-file }
18+
19+
::: maseval.interface.inference.huggingface_scorer.HuggingFaceModelScorer

docs/reference/task.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,42 @@
22

33
Tasks define individual benchmark scenarios including inputs, expected outputs, and metadata for evaluation. Task queues control execution order and scheduling strategy.
44

5-
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L55){ .md-source-file }
5+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L56){ .md-source-file }
66

77
::: maseval.core.task.Task
88

9-
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L27){ .md-source-file }
9+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L28){ .md-source-file }
1010

1111
::: maseval.core.task.TaskProtocol
1212

13-
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L18){ .md-source-file }
13+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L19){ .md-source-file }
1414

1515
::: maseval.core.task.TimeoutAction
1616

1717
## Task Queues
1818

1919
Task queues determine the order in which tasks are executed. Pass a queue to `Benchmark.run(queue=...)` to customize scheduling.
2020

21-
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L86){ .md-source-file }
21+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L87){ .md-source-file }
2222

2323
::: maseval.core.task.BaseTaskQueue
2424

25-
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L256){ .md-source-file }
25+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L257){ .md-source-file }
2626

2727
::: maseval.core.task.SequentialTaskQueue
2828

29-
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L276){ .md-source-file }
29+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L277){ .md-source-file }
30+
31+
::: maseval.core.task.InformativeSubsetQueue
32+
33+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L325){ .md-source-file }
34+
35+
::: maseval.core.task.DISCOQueue
36+
37+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L413){ .md-source-file }
3038

3139
::: maseval.core.task.PriorityTaskQueue
3240

33-
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L322){ .md-source-file }
41+
[:material-github: View source](https://github.com/parameterlab/maseval/blob/main/maseval/core/task.py#L459){ .md-source-file }
3442

3543
::: maseval.core.task.AdaptiveTaskQueue

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ nav:
110110
- Exceptions: reference/exceptions.md
111111
- History: reference/history.md
112112
- Model: reference/model.md
113+
- Scorer: reference/scorer.md
113114
- Seeding: reference/seeding.md
114115
- Simulator: reference/simulator.md
115116
- Tasks: reference/task.md

0 commit comments

Comments
 (0)