[Paper Review] On the Challenges of Using Black-Box APIs for Toxicity Evaluation in Research
This paper investigates how changes in black-box toxicity APIs—specifically Perspective API—over time undermine the reproducibility of research on language model safety. By rescoring widely used benchmarks like HELM and RealToxicityPrompts with newer API versions, the authors find significant shifts in model rankings and toxicity scores, revealing that prior research conclusions may be invalid due to outdated or inconsistent scoring.
Perception of toxicity evolves over time and often differs between geographies and cultural backgrounds. Similarly, black-box commercially available APIs for detecting toxicity, such as the Perspective API, are not static, but frequently retrained to address any unattended weaknesses and biases. We evaluate the implications of these changes on the reproducibility of findings that compare the relative merits of models and methods that aim to curb toxicity. Our findings suggest that research that relied on inherited automatic toxicity scores to compare models and techniques may have resulted in inaccurate findings. Rescoring all models from HELM, a widely respected living benchmark, for toxicity with the recent version of the API led to a different ranking of widely used foundation models. We suggest caution in applying apples-to-apples comparisons between studies and lay recommendations for a more structured approach to evaluating toxicity over time. Code and data are available at https://github.com/for-ai/black-box-api-challenges.
Motivation & Objective
- To investigate how unannounced updates to black-box toxicity APIs affect the reproducibility of research findings in NLP safety evaluation.
- To assess the impact of changing API versions on widely used benchmarks such as HELM and RealToxicityPrompts.
- To demonstrate that prior research relying on static toxicity scores may yield biased or incorrect conclusions due to outdated scoring.
- To provide actionable recommendations for researchers to ensure consistent and reproducible toxicity evaluation over time.
- To highlight the risks of relying on proprietary, version-undefined APIs in academic benchmarking of language models.
Proposed method
- Rescoring previously generated text sequences from the HELM benchmark and RealToxicityPrompts dataset using a more recent version of the Perspective API.
- Comparing model rankings and toxicity metrics (e.g., Toxic Fraction, Expected Maximum Toxicity) before and after rescoring to detect shifts in performance.
- Analyzing changes in toxicity score distributions across different model families and prompting styles over time.
- Replicating published results from 2019–2023 using updated API versions to test reproducibility of prior findings.
- Tracking version inconsistencies in API behavior and lack of formal communication from providers about model updates.
- Establishing a framework for time-aware toxicity evaluation by recommending rescored baselines and version control for API-dependent research.
Experimental results
Research questions
- RQ1How do unannounced updates to black-box toxicity APIs like Perspective API affect the reproducibility of research findings in language model safety evaluation?
- RQ2To what extent do changes in API versions alter the relative ranking of widely used language models in toxicity benchmarks such as HELM?
- RQ3How do outdated toxicity scores in static datasets like RealToxicityPrompts impact the validity of conclusions drawn from prior research?
- RQ4What are the implications of using a non-versioned, dynamic API for evaluating the effectiveness of toxicity mitigation techniques over time?
- RQ5How can researchers ensure consistent and comparable evaluations when relying on proprietary, evolving APIs for toxicity assessment?
Key findings
- Rescoring the RealToxicityPrompts dataset with a newer version of the Perspective API led to a 49% relative decrease in the number of toxic prompts, indicating significant shifts in the underlying toxicity definition.
- In the HELM benchmark, 13 out of 37 evaluated language models experienced changes in their toxicity rankings after rescoring, resulting in 24 total ranking changes for the Toxic Fraction metric.
- The same models produced different toxicity scores when evaluated at different points in time, leading to inconsistent conclusions about model safety and risk.
- Replication of published toxicity mitigation studies (e.g., UDDIA, DExperts, PPLM) showed that results were affected when rescored with the updated API, undermining reproducibility.
- The lack of versioning and communication from API providers prevents researchers from achieving consistent, repeatable, and valid findings across time.
- The study demonstrates that conclusions based on static scores from black-box APIs are inherently unstable and may misrepresent model behavior due to evolving model behavior in the API.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.