SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · aaai_21320 · AAAI · 2022

GALAXY: A Generative Pre-trained Model for Task-Oriented Dialog with Semi-supervised Learning and Explicit Policy Injection

Jian Sun, Fei Huang, Luo Si, Peng Jiang, Yongbin Li, Yuchuan Wu, Yinpei Dai, Min Yang, Wanwei He, Yinhe Zheng, Zheng Cao, Dermot Liu

Open in the Atlas

Code that ran

9 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; 1 honoured the contract we drafted, 1 violated it and 7 have no contract verdict; 0 failures of our instrument; 0 no recorded run), measured 2026-11-22; 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/aaai_21320.json · badge: /api/ran/aaai_21320.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
siat-nlp/GALAXY canonical (classifier label)
classifier basis: census
9 ran · 0 no recorded run
FunctionStatusWhere it lives
bleu Ran
ran on a synthesized input
siat-nlp/GALAXY/galaxy/metrics/metrics.py
code served (permissive licence) · get_code("49fd25cc7470b510")
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 numpy as np

# The function expects:
# - hyps: a list of hypotheses (each hypothesis is a list of tokens/words)
# - refs: a list of references (each reference is a list of tokens/words)

# Create sample hypotheses and references
# These should be lists of tokenized strings (lists of words)
hyps = [
    ['the', 'cat', 'sat', 'on', 'the', 'mat'],
    ['a', 'dog', 'ran', 'quickly']
]

refs = [
    ['the', 'cat', 'is', 'sitting', 'on', 'the', 'mat'],
    ['the', 'dog', 'runs', 'fast']
]

ARGS = {
    'hyps': hyps,
    'refs': refs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
nltk, numpy — 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 Ran
ran, honoured the contract we drafted
siat-nlp/GALAXY/galaxy/metrics/metrics.py
pointer only (licence: Apache-2.0); the stored copy get_code serves, from thu-coai/da-transformer, is pointer only (licence: NOASSERTION) · get_code("616f44af4c97547c")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (Apache-2.0), but get_code serves the stored copy, first harvested from thu-coai/da-transformer, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

equal Ran
ran on a synthesized input
siat-nlp/GALAXY/galaxy/modules/functions.py
code served (permissive licence) · get_code("ae79aca6cbad8b5f")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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)

# Create test tensors - small and distinct shapes
x = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

y = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])

dtype = 'float32'

ARGS = {
    'x': x,
    'y': y,
    'dtype': dtype
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
gather Ran
ran on a synthesized input
siat-nlp/GALAXY/galaxy/models/generator.py
code served (permissive licence) · get_code("4258fc4d59588f88")
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 Tensor, ndim 2, dtype family float, shape (2, 4) 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

torch.manual_seed(0)

# The function gathers elements from var along dimension 0 using idx
# It handles lists, dicts, tensors, and other types recursively
# We need to construct:
# - var: can be a list, dict, tensor, or other type
# - idx: a tensor of indices to select along dimension 0

# Create a small index tensor
idx = torch.tensor([0, 1], dtype=torch.long)

# Create a tensor to gather from (batch size 2, features 4)
tensor_var = torch.randn(2, 4)

# Test with different var types
# 1. Simple tensor
var_tensor = tensor_var

# 2. List of tensors
var_list = [
    torch.randn(2, 4),
    torch.randn(2, 3)
]

# 3. Dict of tensors
var_dict = {
    'a': torch.randn(2, 4),
    'b': torch.randn(2, 3)
}

# 4. Nested structure (list of dicts)
var_nested = [
    {'x': torch.randn(2, 4), 'y': torch.randn(2, 3)},
    torch.randn(2, 5)
]

# Use the tensor case as the main example
ARGS = {
    'var': var_tensor,
    'idx': idx
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
gumbel_softmax Ran
ran on a synthesized input
siat-nlp/GALAXY/galaxy/modules/functions.py
code served (permissive licence) · get_code("bde92178dc0143b3")
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 Tensor, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. 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, 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 numpy as np
import torch
import torch.nn.functional as F

torch.manual_seed(0)

# Create a small input tensor (batch=2, classes=4)
input_tensor = torch.randn(2, 4)

ARGS = {
    "input": input_tensor,
    "tau": 1.0,
    "eps": 1e-10,
    "use_gpu": False,
}
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 Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) 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
parse_args Ran
ran on a synthesized input
siat-nlp/GALAXY/galaxy/args.py
code served (permissive licence) · get_code("d91042e3fa7682db")
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 HParams. 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 argparse
from argparse import ArgumentParser, _ArgumentGroup

torch_available = True
try:
    import torch
    torch.manual_seed(0)
except ImportError:
    torch_available = False

# Create a minimal argument parser that mimics a real parser structure
parser = ArgumentParser(description='Test parser')

# Add some optional arguments (group index 1)
parser.add_argument('--learning_rate', type=float, default=0.001)
parser.add_argument('--batch_size', type=int, default=32)

# Add argument groups (group indices 2+)
train_group = parser.add_argument_group('training')
train_group.add_argument('--epochs', type=int, default=10)
train_group.add_argument('--optimizer', type=str, default='adam')

model_group = parser.add_argument_group('model')
model_group.add_argument('--hidden_dim', type=int, default=128)
model_group.add_argument('--num_layers', type=int, default=2)

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 HParams — a HParams output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a HParams 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
repeat Ran
ran on a synthesized input
siat-nlp/GALAXY/galaxy/models/generator.py
code served (permissive licence) · get_code("568b89f0a8232334")
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 Tensor, ndim 2, dtype family float, shape (6, 4) 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

torch.manual_seed(0)

# Test with a tensor - the main case the function handles
tensor_arg = torch.randn(2, 4)

# Test with times parameter
times_arg = 3

ARGS = {
    "var": tensor_arg,
    "times": times_arg
}
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 Tensor, ndim 2, dtype family float, shape (6, 4) — shape (6, 4) 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
str2bool Ran
ran, violated the contract we drafted
siat-nlp/GALAXY/galaxy/args.py
code served (permissive licence) · get_code("a957019ca36a6747")
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) 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 argparse

def str2bool(v):
    if v.lower() in ('yes', 'true', 't', 'y', '1'):
        return True
    elif v.lower() in ('no', 'false', 'f', 'n', '0'):
        return False
    else:
        raise argparse.ArgumentTypeError('Unsupported value encountered.')

# The function str2bool takes a single parameter 'v' which should be a string
# It converts string representations of boolean values to actual booleans

ARGS = {
    'v': 'true'
}
Setup block drafted by
a language model, Claude Haiku 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 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
unsqueeze Ran
ran on a synthesized input
siat-nlp/GALAXY/galaxy/modules/functions.py
code served (permissive licence) · get_code("a1181fdb4aa3ef27")
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 Tensor, ndim 4, dtype family float, shape (1, 2, 4, 1) 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

torch.manual_seed(0)

# Create a small tensor to test with
input_tensor = torch.randn(2, 4)

# Test case 1: unsqueeze with a list of dimensions
dims_list = [0, 2]

ARGS = {
    "input": input_tensor,
    "dims": dims_list
}
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 Tensor, ndim 4, dtype family float, shape (1, 2, 4, 1) — shape (1, 2, 4, 1) 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 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, 2 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 2 later) and 7 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
str2bool 18 other papers
8 dated earlier, 7 later, 3 same year, order not determinable
1905.00641 (2019-05)
RetinaFace: Single-stage Dense Face Localisation in the Wild
1908.01491 (2019-08)
Pixel2Mesh++: Multi-View 3D Mesh Generation via Deformation
1909.13589 (2019-09)
Domain Adaptation for Semantic Segmentation with Maximum Squares Loss
and 15 more not named here
distinct 2 other papers
1 later, 1 same year, order not determinable
2205.07459 (2022-05)
Directed Acyclic Transformer for Non-Autoregressive Machine Translation
2304.11791 (2023-04)
Directed Acyclic Transformer Pre-training for High-quality Non-autoregressive Text Generation

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

Pre-trained models have proved to be powerful in enhancing task-oriented dialog systems. However, current pre-training methods mainly focus on enhancing dialog understanding and generation tasks while neglecting the exploitation of dialog policy. In this paper, we propose GALAXY, a novel pre-trained dialog model that explicitly learns dialog policy from limited labeled dialogs and large-scale unlabeled dialog corpora via semi-supervised learning. Specifically, we introduce a dialog act prediction task for policy optimization during pre-training and employ a consistency regularization term to refine the learned representation with the help of unlabeled dialogs. We also implement a gating mechanism to weigh suitable unlabeled dialog samples. Empirical results show that GALAXY substantially improves the performance of task-oriented dialog systems, and achieves new state-of-the-art results on benchmark datasets: In-Car, MultiWOZ2.0 and Multi-WOZ2.1, improving their end-to-end combined scores by 2.5, 5.3 and 5.5 points, respectively. We also show that GALAXY has a stronger few-shot ability than existing models under various low-resource settings. For reproducibility, we release the code and data at https: //github.com/siat-nlp/GALAXY.

For agents

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

get_harvested_code_for_paper("aaai_21320")
get_code_for_paper("aaai_21320")
have("aaai_21320")

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

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

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

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

Connect an agent — have() is free.