BigCode Evaluations#
BigCode Evaluation Harness is a framework for the evaluation of code generation models. Use this evaluation type to benchmark code generation tasks such as HumanEval, MBPP, and others.
Tip
Want to experiment first? You can try these benchmarks using the open-source NeMo Evaluator SDK before deploying the microservice. The SDK provides a lightweight way to test evaluation workflows locally.
Tip
For the full list of BigCode tasks, refer to tasks.
Target Configuration
BigCode evaluations require specific endpoint configurations depending on the task:
Completions endpoint: Required for
humaneval,humanevalplus, and allmultiple-*tasksChat endpoint: Required for
humaneval_instructandmbppplus_nemoEither endpoint: Supported for
mbppandmbppplus
{
"target": {
"type": "model",
"model": {
"api_endpoint": {
"url": "https://<nim-base-url>/v1/completions",
"model_id": "meta/llama-3.3-70b-instruct"
}
}
}
}
{
"target": {
"type": "model",
"model": {
"api_endpoint": {
"url": "https://<nim-base-url>/v1/chat/completions",
"model_id": "meta/llama-3.3-70b-instruct"
}
}
}
}
Important
The endpoint URL in your target configuration must match the model_type parameter in your evaluation configuration:
Completions endpoint (
/v1/completions) →"model_type": "completions"Chat endpoint (
/v1/chat/completions) →"model_type": "chat"
Example Job Execution#
You can execute an Evaluation Job using either the Python SDK or cURL as follows, replacing <my-eval-config> with configs shown on this page:
Note
See Job Target and Configuration Matrix for details on target / config compatibility.
from nemo_microservices import NeMoMicroservices
client = NeMoMicroservices(
base_url="http(s)://<your evaluator service endpoint>"
)
job = client.v2.evaluation.jobs.create(
spec={
"target": {
"type": "model",
"name": "my-target-dataset-1",
"namespace": "my-organization",
"model": {
"api_endpoint": {
# Replace NIM_BASE_URL with your specific deployment
"url": f"{NIM_BASE_URL}/v1/chat/completions",
"model_id": "meta/llama-3.1-8b-instruct"
}
},
},
"config": <my-eval-config>
}
)
curl -X "POST" "$EVALUATOR_BASE_URL/v2/evaluation/jobs" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '
{
"spec": {
"target": {
"type": "model",
"name": "my-target-dataset-1",
"namespace": "my-organization",
"model": {
"api_endpoint": {
# Replace NIM_BASE_URL with your specific deployment
"url": f"{NIM_BASE_URL}/v1/chat/completions",
"model_id": "meta/llama-3.1-8b-instruct"
}
}
},
"config": <my-eval-config>
}
}'
from nemo_microservices import NeMoMicroservices
client = NeMoMicroservices(
base_url="http(s)://<your evaluator service endpoint>"
)
job = client.evaluation.jobs.create(
namespace="my-organization",
target={
"type": "model",
"namespace": "my-organization",
"model": {
"api_endpoint": {
# Replace NIM_BASE_URL with your specific deployment
"url": f"{NIM_BASE_URL}/v1/chat/completions",
"model_id": "meta/llama-3.1-8b-instruct"
}
},
},
config=<my-eval-config>
)
curl -X "POST" "$EVALUATOR_BASE_URL/v1/evaluation/jobs" \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '
{
"namespace": "my-organization",
"target": {
"type": "model",
"namespace": "my-organization",
"model": {
"api_endpoint": {
# Replace NIM_BASE_URL with your specific deployment
"url": f"{NIM_BASE_URL}/v1/chat/completions",
"model_id": "meta/llama-3.1-8b-instruct"
}
}
},
"config": <my-eval-config>
}'
For a full example, see Run an Academic LM Harness Eval
Supported Tasks#
The BigCode evaluation harness supports the following tasks in this implementation:
Task |
Description |
Supported Endpoints / Model Types |
|---|---|---|
|
Original HumanEval task |
completions only |
|
Instruction-following version |
chat only |
|
Enhanced HumanEval with additional test cases |
completions only |
|
Mostly Basic Python Problems |
chat and completions |
|
Enhanced MBPP with additional test cases |
chat and completions |
|
NEMO-specific MBPP variant |
chat only |
Endpoints map directly to extra.model_type in your evaluation configuration: /v1/completions → completions; /v1/chat/completions → chat.
HumanEval#
The HumanEval task evaluates a model’s ability to generate correct Python code for a set of programming problems. Each problem includes a function signature and a docstring, and the model must generate a correct implementation.
{
"type": "humaneval",
"params": {
"parallelism": 10,
"request_timeout": 300,
"limit_samples": 10,
"max_tokens": 512,
"temperature": 1.0,
"top_p": 0.01,
"extra": {
"batch_size": 1,
"top_k": 1,
"model_type": "completions"
}
}
}
{
"task_id": "HumanEval/0",
"prompt": "def add(a, b):\n",
"reference": "def add(a, b):\n return a + b\n",
"output": "def add(a, b):\n return a + b\n"
}
{
"tasks": {
"humaneval": {
"metrics": {
"pass@1": {
"scores": {
"pass@1": {
"value": 1.0
}
}
}
}
}
}
}
HumanEval+#
The HumanEval+ task is an enhanced version of HumanEval with additional test cases to provide more robust evaluation.
{
"type": "humanevalplus",
"params": {
"parallelism": 1,
"limit_samples": 1,
"max_tokens": 512,
"temperature": 1.0,
"top_p": 0.01,
"extra": {
"batch_size": 1,
"top_k": 1,
"model_type": "completions"
}
}
}
{
"task_id": "HumanEval+/0",
"prompt": "def add(a, b):\n",
"reference": "def add(a, b):\n return a + b\n",
"output": "def add(a, b):\n return a + b\n"
}
{
"tasks": {
"humanevalplus": {
"metrics": {
"pass@1": {
"scores": {
"pass@1": {
"value": 1.0
}
}
}
}
}
}
}
MBPP#
The MBPP (Mostly Basic Python Problems) task evaluates a model’s ability to solve basic Python programming problems. Each problem includes a prompt and test cases.
{
"type": "mbpp",
"params": {
"parallelism": 10,
"request_timeout": 300,
"limit_samples": 10,
"max_tokens": 512,
"temperature": 1.0,
"top_p": 0.01,
"extra": {
"batch_size": 1,
"top_k": 1,
"model_type": "completions"
}
}
}
{
"type": "mbpp",
"params": {
"parallelism": 10,
"request_timeout": 300,
"limit_samples": 10,
"max_tokens": 512,
"temperature": 1.0,
"top_p": 0.01,
"extra": {
"batch_size": 1,
"top_k": 1,
"model_type": "chat"
}
}
}
{
"task_id": "MBPP/0",
"prompt": "def is_even(n):\n",
"reference": "def is_even(n):\n return n % 2 == 0\n",
"output": "def is_even(n):\n return n % 2 == 0\n"
}
{
"tasks": {
"mbpp": {
"metrics": {
"pass@1": {
"scores": {
"pass@1": {
"value": 1.0
}
}
}
}
}
}
}
MBPP+#
The MBPP+ task is an enhanced version of MBPP with additional test cases for more comprehensive evaluation.
{
"type": "mbppplus",
"params": {
"parallelism": 1,
"limit_samples": 1,
"max_tokens": 512,
"temperature": 1.0,
"top_p": 0.01,
"extra": {
"batch_size": 1,
"top_k": 1,
"model_type": "completions"
}
}
}
{
"type": "mbppplus",
"params": {
"parallelism": 1,
"limit_samples": 1,
"max_tokens": 512,
"temperature": 1.0,
"top_p": 0.01,
"extra": {
"batch_size": 1,
"top_k": 1,
"model_type": "chat"
}
}
}
{
"task_id": "MBPP+/0",
"prompt": "def is_even(n):\n",
"reference": "def is_even(n):\n return n % 2 == 0\n",
"output": "def is_even(n):\n return n % 2 == 0\n"
}
{
"tasks": {
"mbppplus": {
"metrics": {
"pass@1": {
"scores": {
"pass@1": {
"value": 1.0
}
}
}
}
}
}
}
Parameters#
Parameter |
Description |
Required |
Default |
|---|---|---|---|
|
Number of parallel processes for evaluation. |
No |
1 |
|
Limit the number of samples to evaluate (useful for testing). |
No |
All samples |
|
Maximum number of tokens to generate. |
Yes |
— |
|
Controls randomness in generation (0.0 = deterministic). |
No |
1.0 |
|
Nucleus sampling parameter. |
No |
0.01 |
|
List of stop sequences to terminate generation. |
No |
[] |
|
Batch size for generation. |
No |
1 |
|
Top-k sampling parameter. |
No |
1 |
|
Model endpoint type: “chat” or “completions.” Required for most tasks. |
Conditional |
Auto-detected |
|
HuggingFace token for accessing private models or datasets. |
No |
— |
Metrics#
Metric Name |
Description |
Value Range |
Notes |
|---|---|---|---|
|
Fraction of problems for which at least one of the model’s |
0.0 to 1.0 (where 1.0 means all problems were solved correctly) |
|