SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2106.00479 · ACL Findings · 2021

DoT: An efficient Double Transformer for NLP tasks with tables

Julian Eisenschlos, Syrine Krichene, Thomas Müller

arXiv · PDF · Open in the Atlas

Code that ran

5 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 4 failures of our instrument; 4 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/2106.00479.json · badge: /api/ran/2106.00479.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
google-research/tapas marked official in Papers with Code
Papers with Code archive
5 ran · 4 no recorded run
FunctionStatusWhere it lives
_BucketedTensor Ran
ran on a synthesized input · constructed an object; no result was computed
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("d2b385866a52e38e")
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 an instance of its own class, _BucketedTensor: the run constructed the object and did not call it, so no result was computed. 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 tensorflow.compat.v1 as tf
import numpy as np

tf.disable_v2_behavior()

# Create small tensors for testing
batch_size = 2
num_heads = 3
seq_length = 8
embedding_size = 4
bucket_size = 4
num_buckets = 2

# full tensor: rank 4 float32 [batch_size, num_heads, seq_length, embedding_size]
full_tensor = tf.constant(
    np.random.randn(batch_size, num_heads, seq_length, embedding_size).astype(np.float32)
)

# head tensor: rank 4 float32 [batch_size, num_heads, bucket_size, embedding_size]
head_tensor = tf.constant(
    np.random.randn(batch_size, num_heads, bucket_size, embedding_size).astype(np.float32)
)

# tail tensor: rank 4 float32 [batch_size, num_heads, num_buckets - 1, bucket_size, embedding_size]
tail_tensor = tf.constant(
    np.random.randn(batch_size, num_heads, num_buckets - 1, bucket_size, embedding_size).astype(np.float32)
)

# window tensor: rank 4 float32 [batch_size, num_heads, num_buckets - 1, 3 * bucket_size, embedding_size]
window_tensor = tf.constant(
    np.random.randn(batch_size, num_heads, num_buckets - 1, 3 * bucket_size, embedding_size).astype(np.float32)
)

ARGS = {
    "full": full_tensor,
    "head": head_tensor,
    "tail": tail_tensor,
    "window": window_tensor,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _BucketedTensor — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a _BucketedTensor 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
_additive_mask Ran
ran; our contract draft was wrong, not the code
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("2a1bd049028d6725")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
import numpy as np

tf.disable_v2_behavior()

# Create a small binary mask tensor [0, 1]
# Shape: (2, 4) - batch size 2, feature dimension 4
mask_np = np.array([[1, 0, 1, 0], [0, 1, 1, 0]], dtype=np.float32)
mask_tensor = tf.constant(mask_np)

ARGS = {
    "mask": mask_tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
_compute_bucketed_attention_mask Ran
ran; our contract draft was wrong, not the code
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("03d02bc4f2462532")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
import numpy as np

tf.disable_v2_behavior()

class BucketedTensor:
    """Stand-in for a bucketed tensor with expand_to and expand_from methods."""
    def __init__(self, data, shape):
        self.data = data
        self.shape = shape
    
    def expand_to(self, view):
        """Expand tensor to a target view."""
        if view == 'tail':
            return tf.constant(self.data, dtype=tf.int32)
        elif view == 'window':
            return tf.constant(self.data, dtype=tf.int32)
        else:
            return tf.constant(self.data, dtype=tf.int32)
    
    def expand_from(self, view):
        """Expand tensor from a source view."""
        if view == 'tail':
            return tf.constant(self.data, dtype=tf.int32)
        elif view == 'window':
            return tf.constant(self.data, dtype=tf.int32)
        else:
            return tf.constant(self.data, dtype=tf.int32)

class AttendAlwaysTensor:
    """Stand-in for attend_always tensor with expand_from and expand_to methods."""
    def __init__(self, data):
        self.data = data
    
    def expand_from(self, view):
        return tf.constant(self.data, dtype=tf.bool)
    
    def expand_to(self, view):
        return tf.constant(self.data, dtype=tf.bool)

# Create small test data
ids_data = np.array([[[1, 2], [3, 4]], [[5, 6], [7, 8]]], dtype=np.int32)
attend_always_data = np.array([[[True, False], [True, True]], [[False, True], [True, False]]], dtype=bool)

ids = BucketedTensor(ids_data, (2, 2, 2))
attend_always = AttendAlwaysTensor(attend_always_data)

ARGS = {
    'from_view': 'tail',
    'to_view': 'window',
    'ids': ids,
    'attend_always': attend_always
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
_create_bucketed_tensor Ran
ran; our contract draft was wrong, not the code
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("d11811c587844793")
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 _BucketedTensor. 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 tensorflow.compat.v1 as tf
import numpy as np

tf.disable_v2_behavior()

# Create small tensors with distinct dimensions for clarity
batch_size = 2
num_heads = 3
seq_length = 12
header_size = 4
bucket_size = 4
embedding_size = 8

# Rank 4 tensor: [batch_size, num_heads, seq_length, embedding_size]
tensor = tf.constant(
    np.random.randn(batch_size, num_heads, seq_length, embedding_size).astype(np.float32)
)

# Order indices: [batch_size, num_heads, seq_length]
# These should be valid indices for reordering
order_indices = tf.constant(
    np.tile(np.arange(seq_length), (batch_size, num_heads, 1)).astype(np.int32)
)

ARGS = {
    "tensor": tensor,
    "name": "test_bucketed_tensor",
    "order_indices": order_indices,
    "bucket_size": bucket_size,
    "header_size": header_size,
    "num_heads": num_heads,
    "sort_after_projection": True,
    "embedding_size": embedding_size,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type _BucketedTensor — a _BucketedTensor output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a _BucketedTensor 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
_dropout Ran
ran; our contract draft was wrong, not the code
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("892999c5d5451450")
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 SymbolicTensor. 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 tensorflow.compat.v1 as tf
import numpy as np

# Disable eager execution for TensorFlow v1 compatibility
tf.disable_eager_execution()

# Create a small tensor
tensor = tf.constant(np.random.randn(2, 4).astype(np.float32))

# Define dropout probability
dropout_prob = 0.5

ARGS = {
    "tensor": tensor,
    "dropout_prob": dropout_prob,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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
_attention_scores Not yet run
unverified (harvested, no recorded run)
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("89b5ac32bcd95fef")
How it ran

no invocation recorded.

_bucketed_attention_layer Not yet run
unverified (harvested, no recorded run)
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("53a77c65c41a166c")
How it ran

no invocation recorded.

_dense_layer_3d Not yet run
unverified (harvested, no recorded run)
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("b54d98cfb82346cb")
How it ran

no invocation recorded.

create_bucketed_attention_layer Not yet run
unverified (harvested, no recorded run)
google-research/tapas/tapas/utils/attention_utils.py
code served (permissive licence) · get_code("6eb350efd5477531")
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, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 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.

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

Transformer-based approaches have been successfully used to obtain state-of-the-art accuracy on natural language processing (NLP) tasks with semi-structured tables. These model architectures are typically deep, resulting in slow training and inference, especially for long inputs. To improve efficiency while maintaining a high accuracy, we propose a new architecture, DoT , a double transformer model, that decomposes the problem into two sub-tasks: A shallow pruning transformer that selects the top-K tokens, followed by a deep task-specific transformer that takes as input those K tokens. Additionally, we modify the task-specific attention to incorporate the pruning scores. The two transformers are jointly trained by optimizing the task-specific loss. We run experiments on three benchmarks, including entailment and question-answering. We show that for a small drop of accuracy, DoT improves training and inference time by at least 50%. We also show that the pruning transformer effectively selects relevant tokens enabling the end-to-end model to maintain similar accuracy as slower baseline models. Finally, we analyse the pruning and give some insight into its impact on the task model.

For agents

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

get_harvested_code_for_paper("2106.00479")
get_code_for_paper("2106.00479")
have("2106.00479")

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

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

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

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

Connect an agent — have() is free.