SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.15408 · ICML · 2020

Learning Optimal Tree Models under Beam Search

Jingwei Zhuo, Ziru Xu, Wei Dai, Han Zhu, Han Li, Jian Xu, Kun Gai

arXiv · PDF · Open in the Atlas

Code that ran

3 of 9 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 3 have no contract verdict; 0 failures of our instrument; 6 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/2006.15408.json · badge: /api/ran/2006.15408.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
alibaba/x-deeplearning canonical (classifier label)
classifier basis: census
3 ran · 6 no recorded run
FunctionStatusWhere it lives
fopen Ran
ran on a synthesized input
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/data_iterator.py
code served (permissive licence) · get_code("de1047be4a671cdf")
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 FileIO. 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 gzip
import tempfile
import os

# Create a temporary file for testing
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, 'test_file.txt')

# Create a test file
with open(temp_file, 'w') as f:
    f.write('test content')

ARGS = {
    'filename': temp_file,
    'mode': 'r'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type FileIO — a FileIO output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a FileIO 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
record Ran
ran on a synthesized input
alibaba/x-deeplearning/xdl-algorithm-solution/CrossMedia/script/randimg.py
code served (permissive licence) · get_code("e9f3f6b349708ac1")
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 bytes. 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 struct
import random

record_size = 4096

def record(i):
    fmt = 'q' + 'f' * record_size
    return struct.pack(fmt, *[i] + [random.gauss(0, 1) for k in range(record_size)])

# Set seed for reproducibility
random.seed(42)

# The function takes a single parameter 'i' which is used as:
# - The first element packed into the struct (as a long long 'q')
# - Used in the list comprehension just for iteration count (range(record_size))

ARGS = {
    'i': 42
}
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 bytes — a bytes output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a bytes 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
unicode_to_utf8 Ran
ran on a synthesized input
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/data_iterator.py
code served (permissive licence) · get_code("601f5dedb31ec448")
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 torch.nn as nn

torch.manual_seed(0)

# Analyze the function: unicode_to_utf8(d)
# - Takes a dict 'd' as input
# - Iterates over d.items()
# - For each key-value pair, encodes the key to UTF-8 bytes
# - Returns a new dict with encoded keys and same values

# The function expects:
# - d: a dictionary with string keys (unicode) and any values

# Create a test dictionary with unicode string keys
test_dict = {
    "hello": 1,
    "world": 2,
    "café": 3,
    "日本": 4
}

ARGS = {
    "d": test_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 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
bidirectional_dynamic_rnn Not yet run
unverified (harvested, no recorded run)
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/rnn.py
code served (permissive licence) · get_code("03739f18709ea58f")
How it ran

no invocation recorded.

dice Not yet run
unverified (harvested, no recorded run)
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/Dice.py
code served (permissive licence) · get_code("196a35647d46a1c7")
How it ran

no invocation recorded.

dynamic_rnn Not yet run
unverified (harvested, no recorded run)
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/rnn.py
code served (permissive licence) · get_code("e45641a9995b2bd2")
How it ran

no invocation recorded.

eval_model Not yet run
unverified (harvested, no recorded run)
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/model.py
code served (permissive licence) · get_code("88e3effeb58e908b")
How it ran

no invocation recorded.

parametric_relu Not yet run
unverified (harvested, no recorded run)
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/Dice.py
code served (permissive licence) · get_code("063660b9d245fc70")
How it ran

no invocation recorded.

raw_rnn Not yet run
unverified (harvested, no recorded run)
alibaba/x-deeplearning/xdl-algorithm-solution/DIEN/script/rnn.py
code served (permissive licence) · get_code("6a120d4cbe77264b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 4 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 0 later) and 5 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
bidirectional_dynamic_rnn 1 other paper
1 dated earlier
1905.09433 (2019-05)
FiBiNET: Combining Feature Importance and Bilinear feature Interaction for Click-Through Rate Prediction
dynamic_rnn 1 other paper
1 dated earlier
1905.09433 (2019-05)
FiBiNET: Combining Feature Importance and Bilinear feature Interaction for Click-Through Rate Prediction
raw_rnn 1 other paper
1 dated earlier
1905.09433 (2019-05)
FiBiNET: Combining Feature Importance and Bilinear feature Interaction for Click-Through Rate Prediction
unicode_to_utf8 1 other paper
1 dated earlier
1907.01669 (2019-07)
MultiWOZ 2.1: A Consolidated Multi-Domain Dialogue Dataset with State Corrections and State Tracking Baselines

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

Retrieving relevant targets from an extremely large target set under computational limits is a common challenge for information retrieval and recommendation systems. Tree models, which formulate targets as leaves of a tree with trainable node-wise scorers, have attracted a lot of interests in tackling this challenge due to their logarithmic computational complexity in both training and testing. Tree-based deep models (TDMs) and probabilistic label trees (PLTs) are two representative kinds of them. Though achieving many practical successes, existing tree models suffer from the training-testing discrepancy, where the retrieval performance deterioration caused by beam search in testing is not considered in training. This leads to an intrinsic gap between the most relevant targets and those retrieved by beam search with even the optimally trained node-wise scorers. We take a first step towards understanding and analyzing this problem theoretically, and develop the concept of Bayes optimality under beam search and calibration under beam search as general analyzing tools for this purpose. Moreover, to eliminate the discrepancy, we propose a novel algorithm for learning optimal tree models under beam search. Experiments on both synthetic and real data verify the rationality of our theoretical analysis and demonstrate the superiority of our algorithm compared to state-of-the-art methods.

For agents

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

get_harvested_code_for_paper("2006.15408")
get_code_for_paper("2006.15408")
have("2006.15408")

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

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

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

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

Connect an agent — have() is free.