SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2505.16869 · ACL · 2025

MPO: Multilingual Safety Alignment via Reward Gap Optimization

Ting Liu, Tong Wu, An Zhang, Tat-Seng Chua, Wenxuan Zhang, Yang Deng, Yanyan Zhao, Bing Qin, Weixiang Zhao, Jiahe Guo, Yulin Hu

arXiv · PDF · Open in the Atlas

Code that ran

3 of 3 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 2 failures of our instrument; 0 no recorded run), measured 2026-11-23; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2505.16869.json · badge: /api/ran/2505.16869.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
circle-hit/MPO canonical (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
FunctionStatusWhere it lives
create_score_evaluation_response Ran
ran on a synthesized input
circle-hit/MPO/src/llamafactory/api/chat.py
code served (permissive licence) · get_code("f31c69421a40b0a4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned coroutine. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import uuid
from typing import List, Optional

torch.manual_seed(0)

# Stand-in classes for the types used in the function
class Message:
    def __init__(self, role: str, content: str):
        self.role = role
        self.content = content

class ScoreEvaluationRequest:
    def __init__(self, messages: List[Message], max_length: int, model: str):
        self.messages = messages
        self.max_length = max_length
        self.model = model

class ScoreEvaluationResponse:
    def __init__(self, id: str, model: str, scores: List[float]):
        self.id = id
        self.model = model
        self.scores = scores

class ChatModel:
    async def aget_scores(self, messages: List[Message], max_length: int) -> List[float]:
        # Return dummy scores based on number of messages
        return [0.5 + 0.1 * i for i in range(len(messages))]

# Construct request with valid messages (non-empty list)
messages = [
    Message(role="user", content="Hello"),
    Message(role="assistant", content="Hi there"),
]

request = ScoreEvaluationRequest(
    messages=messages,
    max_length=512,
    model="gpt-4"
)

# Construct chat model
chat_model = ChatModel()

# Define ARGS dictionary
ARGS = {
    "request": request,
    "chat_model": chat_model,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type coroutine — a coroutine output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a coroutine output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
dictify Ran
ran; our contract draft was wrong, not the code
circle-hit/MPO/src/llamafactory/api/common.py
code served (permissive licence) · get_code("87aa9acaa81294f5")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
from pydantic import BaseModel

class SampleModel(BaseModel):
    name: str
    value: int
    data: list

# Create a valid Pydantic BaseModel instance
sample_data = SampleModel(name="test", value=42, data=[1, 2, 3])

ARGS = {
    "data": sample_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
jsonify Ran
ran; our contract draft was wrong, not the code
circle-hit/MPO/src/llamafactory/api/common.py
code served (permissive licence) · get_code("57583cf880d95444")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import json
from pydantic import BaseModel

class SampleModel(BaseModel):
    name: str
    value: int
    description: str = "default"

# Create an instance with some fields set
data_instance = SampleModel(name="test", value=42)

ARGS = {
    "data": data_instance
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pydantic — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block

Also present in other papers' code

Of 3 samples lifted from this paper's linked repositories, 3 carry a function identity and 0 do not. Of the 3 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 2 the same month, 2 later) and 0 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
jsonify 28 other papers
13 dated earlier, 2 the same month, 11 later, 2 same year, order not determinable
2403.13372 (2024-03)
LLAMAFACTORY: Unified Efficient Fine-Tuning of 100+ Language Models
2405.04760 (2024-05)
Large Language Models for Cyber Security: A Systematic Literature Review
2406.04496 (2024-06)
Time Sensitive Knowledge Editing through Efficient Finetuning
and 25 more not named here
dictify 14 other papers
9 dated earlier, 1 the same month, 3 later, 1 same year, order not determinable
2403.13372 (2024-03)
LLAMAFACTORY: Unified Efficient Fine-Tuning of 100+ Language Models
2407.08044 (2024-07)
RoLoRA: Fine-tuning Rotated Outlier-free LLMs for Effective Weight-Activation Quantization
2409.13183 (2024-09)
$\textit{SKIntern}$: Internalizing Symbolic Knowledge for Distilling Better CoT Capabilities into Small Language Models
and 11 more not named here
create_score_evaluation_response 2 other papers
2 dated earlier
2403.13372 (2024-03)
LLAMAFACTORY: Unified Efficient Fine-Tuning of 100+ Language Models
2410.10209 (2024-10)
EFFICODER: Enhancing Code Generation in Large Language Models through Efficiency-Aware Fine-tuning

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Large language models (LLMs) have become increasingly central to AI applications worldwide, necessitating robust multilingual safety alignment to ensure secure deployment across diverse linguistic contexts. Existing preference learning methods for safety alignment, such as RLHF and DPO, are primarily monolingual and struggle with noisy multilingual data. To address these limitations, we introduce Multilingual reward gaP Optimization (MPO), a novel approach that leverages the well-aligned safety capabilities of the dominant language (e.g., English) to improve safety alignment across multiple languages. MPO directly minimizes the reward gap difference between the dominant language and target languages, effectively transferring safety capabilities while preserving the original strengths of the dominant language. Extensive experiments on three LLMs, LLaMA-3.1, Gemma-2 and Qwen2.5, validate MPO's efficacy in multilingual safety alignment without degrading general multilingual utility. Our code is available at: https://github.com/circle-hit/MPO.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2505.16869")
get_code_for_paper("2505.16869")
have("2505.16869")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2505.16869.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2505.16869.svg)](https://syntology.ai/paper/2505.16869)

Connect an agent — have() is free.