P3B3
收藏资源简介:
P3B3是由新里斯本大学研究团队创建的葡萄牙语变体偏见基准数据集,专门用于评估大语言模型对欧洲葡萄牙语和巴西葡萄牙语的偏好偏差与可控性。该数据集包含74个精心设计的多轮对话,共计203个对话轮次,通过语言专家手工构建,确保内容在词汇、语法和称呼形式等方面能自然引发两种变体的系统性差异。数据集聚焦于日常交流领域,旨在解决当前大语言模型中葡萄牙语变体表征不平衡的问题,为开发更公平的多语言系统提供评估基础。
P3B3 is a Portuguese variant bias benchmark dataset developed by the research team from the New University of Lisbon, which is specifically dedicated to evaluating the preference bias and controllability of large language models (LLMs) towards European Portuguese and Brazilian Portuguese variants. This dataset consists of 74 carefully designed multi-turn dialogues, with a total of 203 dialogue turns, and was manually constructed by language experts to ensure that the content can naturally trigger systematic differences between the two variants in terms of vocabulary, grammar, and forms of address. Focusing on the domain of daily communication, this dataset aims to address the problem of unbalanced representation of Portuguese variants in current large language models, providing an evaluation basis for the development of more equitable multilingual systems.
P3B3 基准测试数据集概述
P3B3 是一个用于评估大型语言模型 (LLMs) 对葡萄牙语变体 (欧洲葡萄牙语 vs 巴西葡萄牙语) 偏好的基准测试。该工作已被 ACL 2026 的 MeLLM 研讨会接收。
核心目标:通过多轮对话生成和自动化评估,检测 LLMs 在生成回复时是否对特定葡萄牙语变体存在偏好或偏见。
评估方法
- 基于分类器的评分:使用 Transformer 模型将回复分类为欧洲葡萄牙语 (pt_pt) 或巴西葡萄牙语 (pt_br),并输出 0-1 之间的概率分数。
- 基于 LLM 的评分:使用 Gemini 模型对回复进行评估,在 0-10 的尺度上打分,并附带关于葡萄牙语变体偏好和语言特征的说明。
数据与资源
- 配置文件:
config/settings.py包含模型和 API 设置。 - 静态资源:
resources/all_prompts.json包含多轮对话提示。 - 评估结果:生成的模型回复和评分存储在
results/目录。 - 分析输出:分析和可视化结果存储在
outputs/目录。
支持的模型后端
- API 模型:Gemini (通过 LangChain)、Sabia (需设置 API 密钥)。
- VLLM 模型:任何兼容 CUDA 的 Hugging Face 模型 (如
meta-llama/Meta-Llama-3-8B-Instruct)。 - Ollama 模型:需运行本地 Ollama 服务器,格式为
ollama/<model_name>。
使用流程
-
生成对话:使用指定模型生成多轮回复。 bash python -m src.evaluation.generate --model-name-or-path <model_path>
-
评分回复:
- 基于分类器:
python -m src.evaluation.score_with_classifier results/<model_folder> - 基于 LLM 评判:
python -m src.evaluation.score_with_llm results/<model_folder> --judge_name <judge_model>
- 基于分类器:
-
聚合结果:
python -m src.analysis.aggregation -
可视化分析:
python -m src.analysis.turn_analysis <scores_file>
论文与引用
该数据集对应的论文为:P3B3: A Multi-Turn Conversational Benchmark for Measuring European and Brazilian Portuguese Variety Bias in LLMs。

- 1P3B3: A Multi-Turn Conversational Benchmark for Measuring European and Brazilian Portuguese Variety Bias in LLMs新里斯本大学; NOVA LINCS · 2026年



