SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2405.12021 · 2024

Can AI Relate: Testing Large Language Model Response for Mental Health Support

arXiv · PDF · Open in the Atlas

Code that ran

10 of 10 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; 6 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 0 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.12021.json · badge: /api/ran/2405.12021.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
skgabriel/mh-eval canonical (classifier label)
classifier basis: census
10 ran · 0 no recorded run
FunctionStatusWhere it lives
check_valid Ran
ran; our contract draft was wrong, not the code
skgabriel/mh-eval/code/scrape.py
code served (permissive licence) · get_code("b91147af3b048b85")
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

class NameHolder:
    def __init__(self, name_str):
        self.name = name_str

ARGS = {
    'name': NameHolder('test_name')
}
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 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
get_data Ran
ran; our contract draft was wrong, not the code
skgabriel/mh-eval/code/eval_eval.py
code served (permissive licence) · get_code("640c19ab121b9bf7")
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 tuple. 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 csv
import tempfile
import os

# Create a temporary TSV file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.tsv', delete=False)
temp_filename = temp_file.name

# Write test data to the file
writer = csv.writer(temp_file, delimiter='\t')
writer.writerow(['post', 'reply', 'col2', 'col3', 'col4', 'sentiment', 'toxicity'])
writer.writerow(['post1', 'reply1', '0.5', '0.6', '0.7', '0.8', '0.9'])
writer.writerow(['post2', 'reply2', '0.3', '0.4', '0.5', '0.6', '0.7'])
writer.writerow(['post1', 'reply3', '0.2', '0.3', '0.4', '0.5', '0.6'])
writer.writerow(['post3', 'reply4', '', '', '', '', ''])

temp_file.close()

ARGS = {
    'file': temp_filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
get_data Ran
ran, honoured the contract we drafted
skgabriel/mh-eval/code/eval_eval_gpt35.py
code served (permissive licence) · get_code("e688c227f6397a37")
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 tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 csv
import numpy as np
import tempfile
import os

# Create a temporary TSV file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', delete=False, suffix='.tsv', newline='')
temp_filename = temp_file.name

# Write header and sample data
writer = csv.writer(temp_file, delimiter='\t')
writer.writerow(['col0', 'col1', 'col2_er', 'col3_ip', 'col4_ex', 'col5', 'toxicity', 'context'])

# Add rows with context label 'forum w/o demographics' (index 4)
writer.writerow(['text1', 'data1', '0.5', '0.6', '0.7', 'extra1', '0.8', 'forum w/o demographics'])
writer.writerow(['text2', 'data2', '0.3', '0.4', '0.5', 'extra2', '0.75', 'forum w/o demographics'])
writer.writerow(['text3', 'data3', '0.2', '0.3', '0.4', 'extra3', '0.85', 'forum w/o demographics'])

# Add rows with other contexts (should be filtered out)
writer.writerow(['text4', 'data4', '0.1', '0.2', '0.3', 'extra4', '0.9', 'social media'])
writer.writerow(['text5', 'data5', '0.9', '0.95', '0.85', 'extra5', 'failed', 'mental health forum'])
writer.writerow(['text6', 'data6', '0.7', '0.8', '0.9', 'extra6', '', 'clinician'])

temp_file.close()

ARGS = {
    'file': temp_filename
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_data Ran
ran, honoured the contract we drafted
skgabriel/mh-eval/code/eval_eval_gpt4.py
code served (permissive licence) · get_code("4580bbbc4017d06c")
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 tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 csv
import numpy as np
import tempfile
import os

context_labels = ['social media', 'mental health forum', 'clinician', 'forum with demographics', 'forum w/o demographics']

# Create a temporary TSV file with test data
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.tsv', delete=False)
temp_file_path = temp_file.name

# Write header and sample data
writer = csv.writer(temp_file, delimiter='\t')
writer.writerow(['id', 'text', 'er', 'ip', 'ex', 'toxicity', 'context'])

# Add rows with data for context_labels[2] which is 'clinician'
writer.writerow(['1', 'sample text', '0.5', '0.6', '0.7', '0.8', 'clinician'])
writer.writerow(['2', 'another text', '0.4', '0.5', '0.6', '0.75', 'clinician'])
writer.writerow(['3', 'third text', '0.3', '0.4', '0.5', '0.7', 'social media'])
writer.writerow(['4', 'fourth text', '0.2', '0.3', '0.4', 'failed', 'clinician'])
writer.writerow(['5', 'fifth text', '0.6', '0.7', '0.8', '0.9', 'clinician'])
writer.writerow(['6', 'sixth text', '0.1', '0.2', '0.3', '', 'clinician'])

temp_file.close()

ARGS = {
    'file': temp_file_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
get_data Ran
ran, honoured the contract we drafted
skgabriel/mh-eval/code/eval_eval_mental_llama.py
code served (permissive licence) · get_code("73040f3031aa16e2")
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 tuple, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim 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 csv
import numpy as np
import tempfile
import os

# Create a temporary TSV file with sample data
temp_file = tempfile.NamedTemporaryFile(mode='w', suffix='.tsv', delete=False)

# Write header
header = ['col0', 'col1', 'col2', 'col3', 'col4', 'toxicity', 'context']
temp_file.write('\t'.join(header) + '\n')

# Write data rows
# Format: col0, col1, ER (col2), IP (col3), EX (col4), toxicity (col5), context (col6)
rows = [
    ['id1', 'text1', '0.5', '0.6', '0.7', '0.8', 'forum w/o demographics'],
    ['id2', 'text2', '0.3', '0.4', '0.5', '0.9', 'forum w/o demographics'],
    ['id3', 'text3', '0.2', '0.3', '0.4', '0.7', 'clinician'],
    ['id4', 'text4', '0.6', '0.7', '0.8', '0.85', 'forum w/o demographics'],
    ['id5', 'text5', '0.1', '0.2', '0.3', 'failed', 'forum w/o demographics'],
    ['id6', 'text6', '0.4', '0.5', '0.6', '', 'forum w/o demographics'],
]

for row in rows:
    temp_file.write('\t'.join(row) + '\n')

temp_file.close()

ARGS = {
    'file': temp_file.name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
rescore Ran
ran, honoured the contract we drafted
skgabriel/mh-eval/code/process_experts.py
code served (permissive licence) · get_code("0502178177e573d1")
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 int, ndim 0, dtype family int, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# Test case 1: type='er' with response='No'
type_1 = 'er'
response_1 = 'No'

# Test case 2: type='ip' with response containing 'a shallow understanding'
type_2 = 'ip'
response_2 = 'The model shows a shallow understanding of the task'

# Test case 3: type='ex' with response containing 'is generic'
type_3 = 'ex'
response_3 = 'The explanation is generic and lacks detail'

# Test case 4: type with numeric prefix
type_4 = 'other'
response_4 = '5: some response text'

ARGS = {
    'type': 'er',
    'response': 'No'
}
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 int, ndim 0, dtype family int, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
toxic_label Ran
ran, honoured the contract we drafted
skgabriel/mh-eval/code/process_eval_set.py
code served (permissive licence) · get_code("499da536406e8df0")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

# The function toxic_label takes an output dict with 'label' and 'score' keys
# It returns a float based on the label value

output_dict = {
    'label': 'LABEL_0',
    'score': 0.7
}

ARGS = {
    'output': output_dict
}
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 float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
unf_age Ran
ran, honoured the contract we drafted
skgabriel/mh-eval/code/process_demo.py
code served (permissive licence) · get_code("b67c30ee8e360032")
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 float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape 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

torch.manual_seed(0)

ARGS = {
    'r': 'early 20s'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
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
unf_gender Ran
ran; our contract draft was wrong, not the code
skgabriel/mh-eval/code/process_demo.py
code served (permissive licence) · get_code("d17b0b92e13eaf71")
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 torch.nn as nn

def unf_gender(r):
    if ('female' in r or 'woman' in r) and (r != 'male or female' and r != 'male/female'):
        return 'female'
    if 'male' in r and (r != 'male or female' and r != 'male/female'):
        return 'male'
    if 'non-binary' in r:
        return 'non-binary'
    return 'unknown'

# The function takes a single parameter 'r' which is a string
# It checks if certain keywords are in the string and applies logic to classify gender

ARGS = {
    'r': 'female scientist'
}
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 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
unf_race Ran
ran; our contract draft was wrong, not the code
skgabriel/mh-eval/code/process_demo.py
code served (permissive licence) · get_code("daa20d8b26aa3803")
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

ARGS = {
    'r': 'african'
}
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 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 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 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 10 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) are already being piloted for clinical use in hospital systems like NYU Langone, Dana-Farber and the NHS. A proposed deployment use case is psychotherapy, where a LLM-powered chatbot can treat a patient undergoing a mental health crisis. Deployment of LLMs for mental health response could hypothetically broaden access to psychotherapy and provide new possibilities for personalizing care. However, recent high-profile failures, like damaging dieting advice offered by the Tessa chatbot to patients with eating disorders, have led to doubt about their reliability in high-stakes and safety-critical settings. In this work, we develop an evaluation framework for determining whether LLM response is a viable and ethical path forward for the automation of mental health treatment. Our framework measures equity in empathy and adherence of LLM responses to motivational interviewing theory. Using human evaluation with trained clinicians and automatic quality-of-care metrics grounded in psychology research, we compare the responses provided by peer-to-peer responders to those provided by a state-of-the-art LLM. We show that LLMs like GPT-4 use implicit and explicit cues to infer patient demographics like race. We then show that there are statistically significant discrepancies between patient subgroups: Responses to Black posters consistently have lower empathy than for any other demographic group (2%-13% lower than the control group). Promisingly, we do find that the manner in which responses are generated significantly impacts the quality of the response. We conclude by proposing safety guidelines for the potential deployment of LLMs for mental health response.

For agents

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

get_harvested_code_for_paper("2405.12021")
get_code_for_paper("2405.12021")
have("2405.12021")

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

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

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

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

Connect an agent — have() is free.