SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2212.10077 · 2022

DOC: Improving Long Story Coherence With Detailed Outline Control

arXiv · PDF · Open in the Atlas

Code that ran

8 of 16 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 6 have no contract verdict; 2 failures of our instrument; 8 no recorded run), measured 2026-11-22; 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/2212.10077.json · badge: /api/ran/2212.10077.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
yangkevin2/doc-story-generation canonical (classifier label)
classifier basis not recorded on the link
8 ran · 8 no recorded run
FunctionStatusWhere it lives
add_controller_args Ran
ran on a synthesized input
yangkevin2/doc-story-generation/story_generation/common/controller/controller_util.py
code served (permissive licence) · get_code("9307b391bd31f8fe")
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 ArgumentParser. 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 argparse

torch.manual_seed(0)

parser = argparse.ArgumentParser()

ARGS = {
    'parser': parser,
}
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 ArgumentParser — a ArgumentParser output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ArgumentParser 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
add_general_args Ran
ran; our contract draft was wrong, not the code
yangkevin2/doc-story-generation/story_generation/common/util.py
pointer only (licence: MIT); the stored copy get_code serves, from yichenzw/pacing, is pointer only (licence: NONE) · get_code("cf7a81e403862bdc")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yichenzw/pacing, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

create_character_summary Ran
ran on a synthesized input
yangkevin2/doc-story-generation/story_generation/plan_module/plan.py
code served (permissive licence) · get_code("ba042c1588023178")
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.

class Character:
    def __init__(self, description):
        self.description = description

character_strings = {
    'Alice': Character('A young girl with blonde hair and blue eyes'),
    'Bob': Character('A tall man with dark hair and a mysterious demeanor'),
    'Charlie': Character('A middle-aged woman with kind smile and warm presence')
}

ARGS = {
    'character_strings': character_strings
}
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
detect_first_second_person Ran
ran on a synthesized input
yangkevin2/doc-story-generation/story_generation/rewrite_module/heuristics.py
code served (permissive licence) · get_code("2199e84e623c96f3")
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 bool, 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

# Analyze the function: it takes a single parameter 'text' which is a string
# The function processes the text by:
# 1. Replacing smart quotes with regular quotes
# 2. Replacing newlines with spaces
# 3. Splitting by double quotes
# 4. Checking for first/second person pronouns and punctuation in even-indexed parts

# Create test cases for the text parameter
text_examples = [
    'This is a simple sentence.',  # Should return False
    'I am happy.',  # Should return True (contains "I ")
    'You are great!',  # Should return True (contains "You " and "!")
    '"Hello," I said. "How are you?"',  # Should return True (contains "I ", "you'", "!")
]

# Use a simple example that will test the function
test_text = 'I think you are amazing! We should collaborate.'

ARGS = {
    'text': test_text
}
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 bool, 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
infer_is_group Ran
ran on a synthesized input
yangkevin2/doc-story-generation/story_generation/edit_module/entity.py
code served (permissive licence) · get_code("9d496b4e93eed96a")
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 bool, 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 time
import logging
import openai
from scipy.special import softmax
from unittest.mock import Mock, MagicMock

# Set up logging
logging.basicConfig(level=logging.DEBUG)

# Create a minimal tokenizer stand-in
class MinimalTokenizer:
    def encode(self, text):
        # Return a mock token list with length proportional to text
        return list(range(len(text) // 10 + 1))

# Create a minimal gpt3_model stand-in
class MinimalGPT3Model:
    def __init__(self):
        self.tokenizer = MinimalTokenizer()

# Create a mock for openai.Completion.create to avoid actual API calls
def mock_completion_create(**kwargs):
    # Return a properly structured completion response
    return {
        'choices': [
            {
                'logprobs': {
                    'top_logprobs': [
                        {
                            ' single': -1.5,
                            ' group': -0.8
                        }
                    ]
                }
            }
        ]
    }

# Patch the openai module
openai.Completion.create = mock_completion_create

# Define the arguments
ARGS = {
    'name': 'the Fellowship',
    'passage': 'In the land of Middle-earth, the Fellowship of the Ring embarked on a perilous journey to destroy the One Ring and defeat the dark lord Sauron.',
    'gpt3_model': MinimalGPT3Model(),
    'model_string': 'text-davinci-003',
    'plural': False,
    'threshold': 0.5,
    'return_logprobs': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
openai, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
is_imperative_interrogative Ran
ran on a synthesized input
yangkevin2/doc-story-generation/story_generation/plan_module/outline.py
code served (permissive licence) · get_code("b717fef2496260a8")
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 bool, ndim 0, 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.

from nltk import pos_tag

# The function checks if '?' is in text, and if not, calls pos_tag(text)
# and accesses [0].tag to check if it equals 'VB'
# pos_tag returns a list of (word, tag) tuples

text_with_question = "What is this?"
text_with_verb = "run fast"

ARGS = {
    "text": text_with_question
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, ndim 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (fixture:TypeError)
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
num_to_char Ran
ran; our contract draft was wrong, not the code
yangkevin2/doc-story-generation/story_generation/common/util.py
pointer only (licence: MIT); the stored copy get_code serves, from yichenzw/pacing, is pointer only (licence: NONE) · get_code("8ffd1cad03ea46da")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from yichenzw/pacing, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

simple_name_check Ran
ran on a synthesized input
yangkevin2/doc-story-generation/story_generation/plan_module/name_util.py
code served (permissive licence) · get_code("fa3bc34fda104374")
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 bool, 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 string

NAME_BIAS_WORDS = ['protagonist', 'Protagonist', 'PROTAGONIST', 'unnamed', 'Unnamed', 'UNNAMED', 'unknown', 'Unknown', 'UNKNOWN', 'None', 'none', 'None', 'Mr.', 'Mr ', 'Ms.', 'Ms ', 'Mrs.', 'Mrs ', 'Dr.', 'Dr ', 'TBA', 'TBD', 'N/A']

BANNED_NAME_WORDS = NAME_BIAS_WORDS + ["'", '_', '\n', '"', '#', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'redacted', 'mother', 'father', 'gram', 'grand', 'name', 'appearance', 'occupation', 'age', 'gender', 'sex', 'role', 'profession', 'job', 'friend', 'personality', 'trait', ' and ', 'The ', ' the ', 'national', 'country', 'day', 'date', 'description', 'identification', 'Mayor', 'Detective', 'Officer', 'Sheriff', 'Professor', 'Doctor'] + list(string.punctuation)

def simple_name_check(name):
    if len(name.strip()) == 0:
        return False
    if not all([piece.strip()[0].isupper() for piece in name.strip().split()]):
        return False
    if any([word.lower() in name.lower() for word in BANNED_NAME_WORDS]):
        return False
    if sum([1 for letter in name if letter.isupper()]) != len(name.strip().split()):
        return False
    return True

ARGS = {
    "name": "John Smith"
}
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 bool, 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
calculate_repetition_length_penalty Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/rewrite_module/heuristics.py
code served (permissive licence) · get_code("d6064e3f75255c0c")
How it ran

no invocation recorded.

construct_infobox_prompt Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/edit_module/entity.py
code served (permissive licence) · get_code("b0fb798dd04bc58d")
How it ran

no invocation recorded.

display_contiguous_context_section Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/plan_module/outline.py
code served (permissive licence) · get_code("b2a505cd86276f0d")
How it ran

no invocation recorded.

generate_initial_entity_strings Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/plan_module/plan.py
code served (permissive licence) · get_code("4964c6b035fac8e5")
How it ran

no invocation recorded.

generate_outline Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/plan_module/plan.py
code served (permissive licence) · get_code("650c4fbd8b023711")
How it ran

no invocation recorded.

infer_is_character Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/edit_module/entity.py
code served (permissive licence) · get_code("91208f6978255726")
How it ran

no invocation recorded.

longformer_classifier_collate Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/common/controller/models/longformer_classifier.py
code served (permissive licence) · get_code("4951e5ec12bc0cfb")
How it ran

no invocation recorded.

simple_outline_section_check Not yet run
unverified (harvested, no recorded run)
yangkevin2/doc-story-generation/story_generation/plan_module/outline.py
code served (permissive licence) · get_code("512b9c4c5bdd35ef")
How it ran

no invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 2 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 2 later) and 14 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
add_general_args 1 other paper
1 later
2311.04459 (2023-11)
Improving Pacing in Long-Form Story Planning
num_to_char 1 other paper
1 later
2311.04459 (2023-11)
Improving Pacing in Long-Form Story Planning

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

Repositories linked to this paper

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

Abstract

We propose the Detailed Outline Control (DOC) framework for improving long-range plot coherence when automatically generating several-thousand-word-long stories. DOC consists of two complementary components: a detailed outliner and a detailed controller. The detailed outliner creates a more detailed, hierarchically structured outline, shifting creative burden from the main drafting procedure to the planning stage. The detailed controller ensures the more detailed outline is still respected during generation by controlling story passages to align with outline details. In human evaluations of automatically generated stories, DOC substantially outperforms a strong Re3 baseline (Yang et al., 2022) on plot coherence (22.5% absolute gain), outline relevance (28.2%), and interestingness (20.7%). Humans also judged DOC to be much more controllable in an interactive generation setting.

For agents

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

get_harvested_code_for_paper("2212.10077")
get_code_for_paper("2212.10077")
have("2212.10077")

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

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

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

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

Connect an agent — have() is free.