SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2024.findings-acl.916 · ACL Findings · 2024

Knowledge-Infused Prompting: Assessing and Advancing Clinical Text Data Generation with Large Language Models

Carl Yang, Wei Jin, Hejie Cui, Xuan Kan, Joyce Ho, Yuchen Zhuang, Ran Xu, Yu Yue, Wenqi Shi, May Wang

Code that ran

4 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; 0 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 4 failures of our instrument; 2 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/2024.findings-acl.916.json · badge: /api/ran/2024.findings-acl.916.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
ritaranx/ClinGen canonical (classifier label)
classifier basis: census
4 ran · 2 no recorded run
FunctionStatusWhere it lives
clean_str Ran
ran; our contract draft was wrong, not the code
ritaranx/ClinGen/src/medication_attr/clingen.py
code served (permissive licence) · get_code("2fd46a9fc43fa059")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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.

ARGS = {
    "string": "Hello,  World!   This is a test string with   multiple   spaces and special characters: @#$%^&*"
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
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
dispatch_openai_requests Ran
ran; our contract draft was wrong, not the code
ritaranx/ClinGen/src/medication_attr/clingen.py
code served (permissive licence) · get_code("585a6a66de240121")
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 openai
import asyncio
from typing import List, Dict, Any
from unittest.mock import AsyncMock, MagicMock, patch

# Mock the openai module to avoid actual API calls
openai.ChatCompletion = MagicMock()

# Create mock async responses
async def mock_acreate(**kwargs):
    return {"choices": [{"message": {"content": "Mock response"}}]}

openai.ChatCompletion.acreate = AsyncMock(side_effect=mock_acreate)

# Define the arguments
ARGS = {
    "messages_list": [
        [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "What is 2+2?"}
        ],
        [
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "What is 3+3?"}
        ]
    ],
    "model": "gpt-3.5-turbo",
    "temperature": 0.7,
    "max_tokens": 100,
    "top_p": 0.9
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai — 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
load_demo Ran
ran; our contract draft was wrong, not the code
ritaranx/ClinGen/src/medication_attr/clingen.py
code served (permissive licence) · get_code("a7029bb10835862d")
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 list, 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 argparse
import json
import tempfile
import os

# Create a temporary directory with mock data
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'dummy_dataset')
os.makedirs(data_dir, exist_ok=True)

# Create a mock train_few.jsonl file
train_few_path = os.path.join(data_dir, 'train_few.jsonl')
with open(train_few_path, 'w') as f:
    f.write(json.dumps({"id": 1, "text": "example 1"}) + '\n')
    f.write(json.dumps({"id": 2, "text": "example 2"}) + '\n')
    f.write(json.dumps({"id": 3, "text": "example 3"}) + '\n')

# Create a mock args object with necessary attributes
class MockArgs:
    def __init__(self, dataset, data_base_path):
        self.dataset = dataset
        self.data_base_path = data_base_path

# Monkey patch the relative path to use our temp directory
import sys
original_open = open

def patched_open(path, *args, **kwargs):
    if isinstance(path, str) and path.startswith('../data/'):
        # Replace relative path with our temp directory path
        relative_part = path.replace('../data/', '')
        new_path = os.path.join(temp_dir, 'data', relative_part)
        return original_open(new_path, *args, **kwargs)
    return original_open(path, *args, **kwargs)

import builtins
builtins.open = patched_open

ARGS = {
    'args': MockArgs(dataset='dummy_dataset', data_base_path=temp_dir)
}
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 list, ndim 1, dtype family float — a list 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
load_demo Ran
ran; our contract draft was wrong, not the code
ritaranx/ClinGen/src/nli/clingen_step1.py
code served (permissive licence) · get_code("bcbcbcb872ce2071")
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 list, 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 argparse
import json
import tempfile
import os

# Create a temporary directory and file structure to avoid file I/O errors
temp_dir = tempfile.mkdtemp()
data_dir = os.path.join(temp_dir, 'data', 'sample_dataset')
os.makedirs(data_dir, exist_ok=True)

# Create a sample train_few.jsonl file
train_few_path = os.path.join(data_dir, 'train_few.jsonl')
with open(train_few_path, 'w') as f:
    f.write(json.dumps({'text_a': 'example text 1'}) + '\n')
    f.write(json.dumps({'text_a': 'example text 2'}) + '\n')
    f.write(json.dumps({'text_a': 'example text 3'}) + '\n')

# Create a mock args object
class MockArgs:
    def __init__(self):
        self.dataset = 'sample_dataset'
        # Override the data path to use our temp directory
        self.data_root = temp_dir

# Patch the function to use our temp directory
import builtins
original_open = builtins.open

def patched_open(path, *args, **kwargs):
    if '../data/' in path:
        # Replace the relative path with our temp directory path
        new_path = path.replace('../data/', os.path.join(temp_dir, 'data') + '/')
        return original_open(new_path, *args, **kwargs)
    return original_open(path, *args, **kwargs)

builtins.open = patched_open

ARGS = {
    'args': MockArgs()
}
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 list, ndim 1, dtype family float — a list 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
load_demo Not yet run
unverified (harvested, no recorded run)
ritaranx/ClinGen/src/ner/clingen.py
code served (permissive licence) · get_code("3b72e169f6be0118")
How it ran

no invocation recorded.

load_demo Not yet run
unverified (harvested, no recorded run)
ritaranx/ClinGen/src/nli/clingen_step2.py
code served (permissive licence) · get_code("d4e83820076cc14a")
How it ran

no invocation recorded.

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, 5 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 0 later) and 1 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
clean_str 3 other papers
2 dated earlier, 1 same year, order not determinable
2306.15895 (2023-06)
Large Language Model as Attributed Training Data Generator: A Tale of Diversity and Bias
2311.00287 (2023-11)
Knowledge-Infused Prompting: Assessing and Advancing Clinical Text Data Generation with Large Language Models
2403.00815 (2024-03)
RAM-EHR: Retrieval Augmentation Meets Clinical Predictions on Electronic Health Records
dispatch_openai_requests 3 other papers
2 dated earlier, 1 same year, order not determinable
2306.13304 (2023-06)
ToolQA: A Dataset for LLM Question Answering with External Tools
2306.15895 (2023-06)
Large Language Model as Attributed Training Data Generator: A Tale of Diversity and Bias
2402.10110 (2024-02)
Selective Reflection-Tuning: Student-Selected Data Recycling for LLM Instruction-Tuning
load_demo 1 other paper
1 dated earlier
2311.00287 (2023-11)
Knowledge-Infused Prompting: Assessing and Advancing Clinical Text Data Generation with Large Language Models
load_demo 1 other paper
1 dated earlier
2311.00287 (2023-11)
Knowledge-Infused Prompting: Assessing and Advancing Clinical Text Data Generation with Large Language Models
load_demo 1 other paper
1 dated earlier
2311.00287 (2023-11)
Knowledge-Infused Prompting: Assessing and Advancing Clinical Text Data Generation with Large Language Models

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

Clinical natural language processing faces challenges like complex medical terminology and clinical contexts. Recently, large language models (LLMs) have shown promise in this domain. Yet, their direct deployment can lead to privacy issues and are constrained by resources. To address this challenge, we delve into synthetic clinical text generation with LLMs for clinical NLP tasks. We propose an innovative, resource-efficient approach, CLIN-GEN, which infuses knowledge into the process. Our model involves clinical knowledge extraction and context-informed LLM prompting. Both clinical topics and writing styles are drawn from external domain-specific knowledge graphs and LLMs to guide data generation. Our extensive empirical study across 8 clinical NLP tasks and 18 datasets reveals that CLINGEN consistently enhances performance across various tasks by 7.7%-8.7% on average, effectively aligning the distribution of real datasets and enriching the diversity of generated training instances. Our code is available at https://github.com/ritaranx/ClinGen.

For agents

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

get_harvested_code_for_paper("2024.findings-acl.916")
get_code_for_paper("2024.findings-acl.916")
have("2024.findings-acl.916")

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

curl https://syntology.ai/api/ran/2024.findings-acl.916.json

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

[![Syntology run record](https://syntology.ai/api/ran/2024.findings-acl.916.svg)](https://syntology.ai/paper/2024.findings-acl.916)

Connect an agent — have() is free.