SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2206.15474 · NeurIPS · 2022

Forecasting Future World Events with Neural Networks

U Berkeley, Dan Hendrycks, Jacob Steinhardt, Andy Zou, Owain Evans, Dawn Song, Tristan Xiao, Ryan Jia, Joe Kwon, Richard Li

arXiv · PDF · Open in the Atlas

Code that ran

1 of 1 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; 1 failure of our instrument; 0 no recorded run), measured 2026-11-23; 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/2206.15474.json · badge: /api/ran/2206.15474.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
andyzoujm/autocast canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
cross_attention_forward Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
andyzoujm/autocast/autocast_experiments/src/model.py
code served (permissive licence) · get_code("6bef6bdd6eb44070")
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 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 torch
import torch.nn as nn
import torch.nn.functional as F

torch.manual_seed(0)

# Define a minimal self object that has all the required attributes and methods
class CrossAttentionModule(nn.Module):
    def __init__(self):
        super().__init__()
        self.n_heads = 2
        self.d_kv = 3
        self.inner_dim = self.n_heads * self.d_kv  # 6
        self.dropout = 0.1
        self.has_relative_attention_bias = True
        self.score_storage = None
        
        # Linear layers
        input_dim = 8
        kv_dim = 10
        self.q = nn.Linear(input_dim, self.inner_dim, bias=False)
        self.k = nn.Linear(kv_dim, self.inner_dim, bias=False)
        self.v = nn.Linear(kv_dim, self.inner_dim, bias=False)
        self.o = nn.Linear(self.inner_dim, input_dim, bias=False)
        
    def compute_bias(self, qlen, klen):
        # Return a position bias tensor of shape (1, n_heads, qlen, klen)
        return torch.randn(1, self.n_heads, qlen, klen)
    
    def forward(self, input, mask=None, kv=None, position_bias=None, past_key_value_state=None, head_mask=None, query_length=None, use_cache=False, output_attentions=False):
        return cross_attention_forward(self, input, mask, kv, position_bias, past_key_value_state, head_mask, query_length, use_cache, output_attentions)

def cross_attention_forward(self, input, mask=None, kv=None, position_bias=None, past_key_value_state=None, head_mask=None, query_length=None, use_cache=False, output_attentions=False):
    """
    This only works for computing cross attention over the input
    """
    assert kv != None
    assert head_mask == None
    assert position_bias != None or self.has_relative_attention_bias
    bsz, qlen, dim = input.size()
    n_heads, d_heads = (self.n_heads, self.d_kv)
    klen = kv.size(1)
    q = self.q(input).view(bsz, -1, n_heads, d_heads).transpose(1, 2)
    if past_key_value_state == None:
        k = self.k(kv).view(bsz, -1, n_heads, d_heads).transpose(1, 2)
        v = self.v(kv).view(bsz, -1, n_heads, d_heads).transpose(1, 2)
    else:
        k, v = past_key_value_state
    scores = torch.einsum('bnqd,bnkd->bnqk', q, k)
    if mask is not None:
        scores += mask
    if position_bias is None:
        position_bias = self.compute_bias(qlen, klen)
    scores += position_bias
    if self.score_storage is None:
        self.score_storage = scores
    attn = F.softmax(scores.float(), dim=-1).type_as(scores)
    attn = F.dropout(attn, p=self.dropout, training=self.training)
    output = torch.matmul(attn, v)
    output = output.transpose(1, 2).contiguous().view(bsz, -1, self.inner_dim)
    output = self.o(output)
    if use_cache:
        output = (output,) + ((k, v),)
    else:
        output = (output,) + (None,)
    if output_attentions:
        output = output + (attn,)
    if self.has_relative_attention_bias:
        output = output + (position_bias,)
    return output

# Create the module instance
self_module = CrossAttentionModule()

# Create input tensors
bsz = 2
qlen = 5
input_dim = 8
klen = 7
kv_dim = 10

input_tensor = torch.randn(bsz, qlen, input_dim)
kv_tensor = torch.randn(bsz, klen, kv_dim)

# Create position_bias (1, n_heads, qlen, klen)
position_bias_tensor = torch.randn(1, self_module.n_heads, qlen, klen)

# Create mask (broadcastable to scores shape: bsz, n_heads, qlen, klen)
mask_tensor = torch.randn(1, 1, qlen, klen)

ARGS = {
    'self': self_module,
    'input': input_tensor,
    'mask': mask_tensor,
    'kv': kv_tensor,
    'position_bias': position_bias_tensor,
    'past_key_value_state': None,
    'head_mask': None,
    'query_length': None,
    'use_cache': False,
    'output_attentions': False
}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
torch — 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

Also present in other papers' code

Of 1 samples lifted from this paper's linked repositories, 1 carry a function identity and 0 do not. Of the 1 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 0 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
cross_attention_forward 10 other papers
2 dated earlier, 8 later · 1 only as an assembly brick
2108.06314 (2021-08)
A Dataset for Answering Time-Sensitive Questions
2112.08688 (2021-12)
Evidentiality-guided Generation for Knowledge-Intensive NLP Tasks
2207.12888 (2022-07)
LaKo: Knowledge-driven Visual Question Answering via Late Knowledge-to-Text Injection
and 7 more not named here

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

Repositories linked to this paper

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

Abstract

Forecasting future world events is a challenging but valuable task. Forecasts of climate, geopolitical conflict, pandemics and economic indicators help shape policy and decision making. In these domains, the judgment of expert humans contributes to the best forecasts. Given advances in language modeling, can these forecasts be automated? To this end, we introduce Autocast, a dataset containing thousands of forecasting questions and an accompanying news corpus. Questions are taken from forecasting tournaments, ensuring high quality, real-world importance, and diversity. The news corpus is organized by date, allowing us to precisely simulate the conditions under which humans made past forecasts (avoiding leakage from the future). Motivated by the difficulty of forecasting numbers across orders of magnitude (e.g. global cases of COVID-19 in 2022), we also curate IntervalQA, a dataset of numerical questions and metrics for calibration. We test language models on our forecasting task and find that performance is far below a human expert baseline. However, performance improves with increased model size and incorporation of relevant information from the news corpus. In sum, Autocast poses a novel challenge for large language models and improved performance could bring large practical benefits. 36th Conference on Neural Information Processing Systems (NeurIPS 2022) Track on Datasets and Benchmarks.

For agents

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

get_harvested_code_for_paper("2206.15474")
get_code_for_paper("2206.15474")
have("2206.15474")

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

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

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

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

Connect an agent — have() is free.