SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2606.06027 · 2026

RedditPersona: A Modular Framework for Community-Conditioned LLM Adaptation from Reddit

Huong Nguyen, Amirhossein Ghaffari, Ali Goodarzi, Simo Hosio, Lauri Lovén, Ekaterina Gilman

arXiv · PDF · Open in the Atlas

Code that ran

6 of 6 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; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 0 no recorded run), measured 2026-11-24; 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/2606.06027.json · badge: /api/ran/2606.06027.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
Ahghaffari/redditpersona canonical (classifier label)
classifier basis: census
6 ran · 0 no recorded run
FunctionStatusWhere it lives
bertscore_f1 Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Ahghaffari/redditpersona/evaluation/metrics.py
code served (permissive licence) · get_code("a81520d6c5e2629b")
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 logging

logger = logging.getLogger(__name__)

# Setup for bertscore_f1 function
# The function takes two parameters:
# - generated: List[str] - list of generated text strings
# - reference: List[str] - list of reference text strings

generated = [
    "The cat sat on the mat",
    "A dog ran in the park"
]

reference = [
    "The cat is sitting on the mat",
    "The dog was running in the park"
]

ARGS = {
    "generated": generated,
    "reference": reference
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
bert_score — 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
compute_nmi_ari Ran
ran; our contract draft was wrong, not the code
Ahghaffari/redditpersona/grouping/analyze.py
code served (permissive licence) · get_code("dab5aea1fd9f7b76")
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
import numpy as np
from sklearn.metrics import normalized_mutual_info_score, adjusted_rand_score

torch.manual_seed(0)

# Create two assignment dictionaries mapping user IDs to cluster assignments
# The function expects dict[str, str] for both parameters

baseline_assignments = {
    'user_1': 'cluster_A',
    'user_2': 'cluster_B',
    'user_3': 'cluster_A',
    'user_4': 'cluster_C',
    'user_5': '_other',  # residual bucket - will be filtered out
    'user_6': 'none',    # residual bucket - will be filtered out
}

target_assignments = {
    'user_1': 'cluster_X',
    'user_2': 'cluster_Y',
    'user_3': 'cluster_X',
    'user_4': 'cluster_Y',
    'user_5': '_other',  # residual bucket - will be filtered out
    'user_6': 'other',   # residual bucket - will be filtered out
}

ARGS = {
    'baseline_assignments': baseline_assignments,
    'target_assignments': target_assignments,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, sklearn, 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
consolidate_top_k Ran
ran; our contract draft was wrong, not the code
Ahghaffari/redditpersona/grouping/_consolidate.py
code served (permissive licence) · get_code("5396773ab9519c4c")
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 1, 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 torch
from collections import Counter

# Set seed for reproducibility
torch.manual_seed(0)

# Create a simple partition: member -> community_id
# Let's create a partition where we have 5 communities with different sizes
# Community 0: 10 members
# Community 1: 8 members
# Community 2: 5 members
# Community 3: 3 members
# Community 4: 2 members
partition = {
    # Community 0 (size 10)
    'member_0': 0, 'member_1': 0, 'member_2': 0, 'member_3': 0, 'member_4': 0,
    'member_5': 0, 'member_6': 0, 'member_7': 0, 'member_8': 0, 'member_9': 0,
    # Community 1 (size 8)
    'member_10': 1, 'member_11': 1, 'member_12': 1, 'member_13': 1, 'member_14': 1,
    'member_15': 1, 'member_16': 1, 'member_17': 1,
    # Community 2 (size 5)
    'member_18': 2, 'member_19': 2, 'member_20': 2, 'member_21': 2, 'member_22': 2,
    # Community 3 (size 3)
    'member_23': 3, 'member_24': 3, 'member_25': 3,
    # Community 4 (size 2)
    'member_26': 4, 'member_27': 4,
}

# top_k: keep the top 2 largest communities
top_k = 2

# other_label: label for members whose communities are merged
other_label = 'other'

ARGS = {
    'partition': partition,
    'top_k': top_k,
    'other_label': other_label,
}
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 tuple, ndim 1, 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
distinct_n Ran
ran, honoured the contract we drafted
Ahghaffari/redditpersona/evaluation/metrics.py
code served (permissive licence) · get_code("c476c19c707984ba")
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)

# The function takes:
# 1. texts: List[str] - a list of text strings
# 2. n: int - the n-gram size

# Construct test data
texts = [
    "the quick brown fox jumps over the lazy dog",
    "the dog sat on the mat",
    "quick brown fox"
]

n = 2

ARGS = {
    "texts": texts,
    "n": n
}
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
load_config Ran
ran; our contract draft was wrong, not the code
Ahghaffari/redditpersona/config.py
code served (permissive licence) · get_code("8aee9a64c0d06533")
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 AppConfig. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 os
import tempfile
from pathlib import Path
from dataclasses import dataclass

# Create a temporary YAML config file for testing
temp_dir = tempfile.mkdtemp()
config_path = Path(temp_dir) / "config.yaml"

# Write a minimal valid YAML config
config_content = """
data_dir: /tmp/test_data
anonymization:
  enabled: true
  hash_usernames: true
  strip_pii_ner: true
  remove_urls: true
  ner_model: en_core_web_sm
training:
  models:
    - name: ibm-granite/granite-4.1-3b
      short_name: granite-4.1-3b
  strategies:
    - strategy_1_subreddit
    - strategy_2_graph
  max_communities: 8
  max_train_samples: 20000
  device: cpu
  output_dir: /tmp/adapters
  model_cache_dir: /tmp/models
  test_ratio: 0.1
  val_ratio: 0.1
  split_method: random
  max_context_comments: 3
  max_seq_length: 512
  min_reply_length: 10
  lora_r: 16
  lora_alpha: 32
  lora_dropout: 0.05
  lora_target_modules:
    - q_proj
    - k_proj
  load_in_4bit: true
  bnb_4bit_compute_dtype: float16
  bnb_4bit_quant_type: nf4
  num_epochs: 1
  per_device_train_batch_size: 2
  gradient_accumulation_steps: 8
  learning_rate: 0.0001
  warmup_ratio: 0.05
  weight_decay: 0.01
  lr_scheduler_type: cosine
  logging_steps: 25
  save_strategy: no
  fp16: false
  bf16: false
evaluation:
  max_new_tokens: 256
  temperature: 0.7
  top_p: 0.9
  do_sample: true
  num_test_samples: 200
  generation_batch_size: 4
  output_dir: /tmp/evaluation
  metrics:
    - perplexity
    - distinct
"""

with open(config_path, 'w') as f:
    f.write(config_content)

ARGS = {
    'path': str(config_path)
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AppConfig — a AppConfig output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AppConfig 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
mauve_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Ahghaffari/redditpersona/evaluation/metrics.py
code served (permissive licence) · get_code("9dbadc3c9b386dab")
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 logging

logger = logging.getLogger(__name__)

# Setup for mauve_score function
generated = [
    "This is a generated text sample.",
    "Another generated example for testing."
]

reference = [
    "This is a reference text sample.",
    "Another reference example for comparison."
]

device_id = -1

ARGS = {
    "generated": generated,
    "reference": reference,
    "device_id": device_id
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
mauve — 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

Also present in other papers' code

Of 6 samples lifted from this paper's linked repositories, 6 carry a function identity and 0 do not. Of the 6 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 6 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

Community-conditioned language model adaptation needs choices about data collection, community definition, and evaluation that are currently made independently in each study, making it hard to compare assumptions or reuse artifacts. We present RedditPersona, a modular framework that standardizes these choices: it collects Reddit posts and comments, profiles active users, partitions them under five grouping strategies (subreddit-based, graph-structural, semantic, hybrid, and interaction-based), trains a parameter-efficient adapter per strategy via QLoRA, and evaluates them under a shared metric suite spanning fluency, fidelity, distributional alignment, and community identifiability. Applied to 112 subreddits in the urban well-being domain (301,429 user profiles, 16M+ comments), we find that adapters' behavioral identifiability tracks each strategy's agreement with the subreddit baseline, and that a consistent trade-off between identifiability and distributional similarity to real text holds across all five strategies. The code and configuration files are available at: https://github.com/Ahghaffari/redditpersona.

For agents

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

get_harvested_code_for_paper("2606.06027")
get_code_for_paper("2606.06027")
have("2606.06027")

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

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

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

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

Connect an agent — have() is free.