SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.14125 · 2024

ALI-Agent: Assessing LLMs' Alignment with Human Values via Agent-based Evaluation

arXiv · PDF · Open in the Atlas

Code that ran

2 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; 1 failure of our instrument; 1 no recorded run), measured 2026-11-24; 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/2405.14125.json · badge: /api/ran/2405.14125.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
sophiezheng998/ali-agent canonical (classifier label)
classifier basis: census
2 ran · 1 no recorded run
FunctionStatusWhere it lives
chat Ran
ran on a synthesized input
sophiezheng998/ali-agent/simulation/utils.py
code served (permissive licence) · get_code("6bc98d55a886b87d")
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 torch
import numpy as np
from unittest.mock import Mock, MagicMock
import logging

# Set seed for reproducibility
torch.manual_seed(0)
np.random.seed(0)

# Create a mock logger
logger = logging.getLogger('test_logger')

# Create mock pipeline for vicuna/llama models
def mock_pipeline(prompt, do_sample=True, top_k=10, num_return_sequences=1, temperature=0.7, max_length=1024, text_inputs=None):
    if text_inputs is not None:
        prompt = text_inputs
    return [{'generated_text': prompt + ' This is a mock response from the pipeline.'}]

# Create mock tokenizer
mock_tokenizer = Mock()
mock_tokenizer.encode = Mock(return_value=[1, 2, 3, 4])
mock_tokenizer.decode = Mock(return_value='mock decoded text')

# Create mock chatglm model
mock_chatglm = Mock()
mock_chatglm.chat = Mock(return_value=('mock response', 0))

# Create mock gemini model
mock_gemini = Mock()
mock_generate_response = Mock()
mock_generate_response.text = 'This is a mock Gemini response'
mock_gemini.generate_content = Mock(return_value=mock_generate_response)

# Build the parameters dictionary
parameters = {
    'llm_name': 'gpt-4o',
    'temperature': 0.0,
    'gemini_model': mock_gemini,
    'logger': logger,
    'type': 'stereotype',
    'pipeline': mock_pipeline,
    'chatglm': mock_chatglm,
    'tokenizer': mock_tokenizer,
    'api_key': 'test-api-key',
    'api_endpoint': None,
}

# Define the function arguments
ARGS = {
    'user_prompt': 'What is the capital of France?',
    'sys_prompt': 'You are a helpful assistant.',
    'parameters': parameters,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, openai, torch, transformers — 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
correct_json_string Ran
ran; our contract draft was wrong, not the code
sophiezheng998/ali-agent/simulation/utils.py
code served (permissive licence) · get_code("0cdb885766726406")
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 re

def correct_json_string(s):
    s = re.sub("\\'", '\\"', s)
    s = re.sub(',\\s*([\\]}])', '\\1', s)
    s = re.sub('(?<!\\\\)"', '\\"', s)
    s = re.sub('\\\\\\\\"', '\\\\"', s)
    s = re.sub('"\\s*(true|false|null)\\s*"', '\\1', s, flags=re.IGNORECASE)
    return s

# Construct a valid string argument that would benefit from JSON correction
# Example: a malformed JSON-like string with single quotes, trailing commas, etc.
test_string = "{'name': 'test', 'values': [1, 2, 3,], 'flag': \"true\",}"

ARGS = {
    's': test_string
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — 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
chat_gpt_core Not yet run
unverified (harvested, no recorded run)
sophiezheng998/ali-agent/simulation/utils.py
code served (permissive licence) · get_code("2bbe0199c2f99381")
How it ran

no invocation recorded.

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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 3 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.

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-24.

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) can elicit unintended and even harmful content when misaligned with human values, posing severe risks to users and society. To mitigate these risks, current evaluation benchmarks predominantly employ expert-designed contextual scenarios to assess how well LLMs align with human values. However, the labor-intensive nature of these benchmarks limits their test scope, hindering their ability to generalize to the extensive variety of open-world use cases and identify rare but crucial long-tail risks. Additionally, these static tests fail to adapt to the rapid evolution of LLMs, making it hard to evaluate timely alignment issues. To address these challenges, we propose ALI-Agent, an evaluation framework that leverages the autonomous abilities of LLM-powered agents to conduct in-depth and adaptive alignment assessments. ALI-Agent operates through two principal stages: Emulation and Refinement. During the Emulation stage, ALI-Agent automates the generation of realistic test scenarios. In the Refinement stage, it iteratively refines the scenarios to probe long-tail risks. Specifically, ALI-Agent incorporates a memory module to guide test scenario generation, a tool-using module to reduce human labor in tasks such as evaluating feedback from target LLMs, and an action module to refine tests. Extensive experiments across three aspects of human values--stereotypes, morality, and legality--demonstrate that ALI-Agent, as a general evaluation framework, effectively identifies model misalignment. Systematic analysis also validates that the generated test scenarios represent meaningful use cases, as well as integrate enhanced measures to probe long-tail risks. Our code is available at https://github.com/SophieZheng998/ALI-Agent.git

For agents

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

get_harvested_code_for_paper("2405.14125")
get_code_for_paper("2405.14125")
have("2405.14125")

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

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

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

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

Connect an agent — have() is free.