SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2312.00874 · EMNLP · 2023

Hi-ArG: Exploring the Integration of Hierarchical Argumentation Graphs in Language Pretraining

Qi Zhang, Zhongyu Wei, Xuanjing Huang, Xinyu Zhang, Meng Han, Ruofei Lai, Zhao Cao, Rong Ye, Jingcong Liang

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 2 have no contract verdict; 1 failure 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/2312.00874.json · badge: /api/ran/2312.00874.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
ljcleo/Hi-ArG community
Papers with Code archive
3 ran · 6 no recorded run
FunctionStatusWhere it lives
GreaseArgGraphEmbeddings Ran
ran on a synthesized input
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("5d05826a61265e4c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from torch import Tensor
from transformers import RobertaConfig

class GreaseArgConfig(RobertaConfig):
    model_type: str = 'GreaseArg'

    def __init__(self, input_text: bool=True, input_graph: bool=True, gnn_pos_embed_size: int=4, num_joint_layers: int=9, num_gnn_attn_heads: int=2, gnn_hidden_size: int=256, gnn_hidden_act: str | nn.Module='relu', num_mix_layers: int=1, mix_hidden_size: int=512, mix_hidden_act: str | nn.Module='relu', num_joint_attn_heads: int=8, **kwargs) -> None:
        super().__init__(**kwargs)
        if not input_text and (not input_graph):
            raise ValueError
        self.input_text = input_text
        self.input_graph = input_graph
        self.gnn_pos_embed_size = gnn_pos_embed_size
        self.num_joint_layers = num_joint_layers
        self.num_gnn_attention_heads = num_gnn_attn_heads
        self.gnn_hidden_size = gnn_hidden_size
        self.gnn_hidden_act = gnn_hidden_act
        self.num_mix_layers = num_mix_layers
        self.mix_hidden_size = mix_hidden_size
        self.mix_hidden_act = mix_hidden_act
        self.num_joint_attn_heads = num_joint_attn_heads

    @staticmethod
    def from_roberta_config(config: RobertaConfig, **kwargs) -> 'GreaseArgConfig':
        kwargs.update(config.to_dict())
        return GreaseArgConfig(**kwargs)

    def get_roberta_config(self) -> RobertaConfig:
        return RobertaConfig(**self.to_dict())

class GreaseArgGraphEmbeddings(nn.Module):

    def __init__(self, config: GreaseArgConfig) -> None:
        super().__init__()
        self.node_embedding = nn.Linear(config.hidden_size, config.gnn_hidden_size)
        self.edge_embedding = nn.Linear(config.hidden_size, config.gnn_hidden_size)
        self.position_embedding = nn.Linear(config.gnn_pos_embed_size, config.gnn_hidden_size)
        self.node_layer_norm = nn.LayerNorm(config.gnn_hidden_size, eps=config.layer_norm_eps)
        self.edge_layer_norm = nn.LayerNorm(config.gnn_hidden_size, eps=config.layer_norm_eps)
        self.dropout = nn.Dropout(config.hidden_dropout_prob)

    def forward(self, x: Tensor, edge_attr: Tensor, pos: Tensor) -> tuple[Tensor, Tensor]:
        x = self.node_embedding(x)
        pos = self.position_embedding(pos)
        x = x + pos
        x = self.node_layer_norm(x)
        x = self.dropout(x)
        edge_attr = self.edge_embedding(edge_attr)
        edge_attr = self.edge_layer_norm(edge_attr)
        edge_attr = self.dropout(edge_attr)
        return (x, edge_attr)


config = GreaseArgConfig(
    hidden_size=64,
    gnn_hidden_size=128,
    gnn_pos_embed_size=4,
    layer_norm_eps=1e-12,
    hidden_dropout_prob=0.1
)

INIT_ARGS = {
    'config': config
}

ARGS = {
    'x': torch.randn(2, 3, 64),
    'edge_attr': torch.randn(2, 5, 64),
    'pos': torch.randn(2, 3, 4)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch, transformers — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
GreaseArgMixLayer Ran
ran on a synthesized input
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("5530c2f837ba74df")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) 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
from transformers import RobertaConfig

class GreaseArgConfig(RobertaConfig):
    model_type: str = 'GreaseArg'

    def __init__(self, input_text: bool=True, input_graph: bool=True, gnn_pos_embed_size: int=4, num_joint_layers: int=9, num_gnn_attn_heads: int=2, gnn_hidden_size: int=256, gnn_hidden_act: str | nn.Module='relu', num_mix_layers: int=1, mix_hidden_size: int=512, mix_hidden_act: str | nn.Module='relu', num_joint_attn_heads: int=8, **kwargs) -> None:
        super().__init__(**kwargs)
        if not input_text and (not input_graph):
            raise ValueError
        self.input_text = input_text
        self.input_graph = input_graph
        self.gnn_pos_embed_size = gnn_pos_embed_size
        self.num_joint_layers = num_joint_layers
        self.num_gnn_attention_heads = num_gnn_attn_heads
        self.gnn_hidden_size = gnn_hidden_size
        self.gnn_hidden_act = gnn_hidden_act
        self.num_mix_layers = num_mix_layers
        self.mix_hidden_size = mix_hidden_size
        self.mix_hidden_act = mix_hidden_act
        self.num_joint_attn_heads = num_joint_attn_heads

def get_activation(act: str | nn.Module) -> nn.Module:
    from transformers.activations import ACT2FN
    return ACT2FN[act] if isinstance(act, str) else act

class GreaseArgMixLayer(nn.Module):

    def __init__(self, config: GreaseArgConfig) -> None:
        super().__init__()
        self.hidden_size: int = config.hidden_size
        merge_hidden_size: int = config.hidden_size + config.gnn_hidden_size
        self.dense_1 = nn.Linear(merge_hidden_size, config.mix_hidden_size)
        self.dense_2 = nn.Linear(config.mix_hidden_size, merge_hidden_size)
        self.dropout = nn.Dropout(config.hidden_dropout_prob)
        self.activation: nn.Module = get_activation(config.mix_hidden_act)
        self.layer_norm = nn.LayerNorm(config.mix_hidden_size, eps=config.layer_norm_eps)

    def forward(self, lm_x: torch.Tensor, gnn_x: torch.Tensor, ptr: torch.Tensor) -> tuple[torch.Tensor, torch.Tensor]:
        head_x: torch.Tensor = lm_x[:, 0, :]
        top_x: torch.Tensor = gnn_x[ptr[1:] - 1, :]
        x: torch.Tensor = torch.cat([head_x, top_x], dim=1)
        x = self.dense_1(x)
        x = self.dropout(x)
        x = self.activation(x)
        x = self.layer_norm(x)
        x = self.dense_2(x)
        head_x = x[:, :self.hidden_size]
        top_x = x[:, self.hidden_size:]
        lm_x = torch.cat([head_x.unsqueeze(1), lm_x[:, 1:, :]], dim=1)
        graphs_x: list[torch.Tensor] = []
        for i, (j, k) in enumerate(zip(ptr[:-1], ptr[1:])):
            graphs_x.extend([top_x[i:i + 1], gnn_x[j + 1:k]])
        gnn_x = torch.cat(graphs_x)
        return (lm_x, gnn_x)

config = GreaseArgConfig(
    hidden_size=4,
    gnn_hidden_size=3,
    mix_hidden_size=8,
    hidden_dropout_prob=0.1,
    layer_norm_eps=1e-12,
    mix_hidden_act='relu'
)

INIT_ARGS = {
    'config': config
}

ARGS = {
    'lm_x': torch.randn(2, 5, 4),
    'gnn_x': torch.randn(6, 3),
    'ptr': torch.tensor([0, 3, 6], dtype=torch.long)
}
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
torch, transformers — 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
get_activation Ran
ran; our contract draft was wrong, not the code
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("5c02dbcbfa96913e")
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 ReLU. 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
from transformers.activations import ACT2FN

torch.manual_seed(0)

# Test case 1: string activation name
act_str = "relu"

# Test case 2: nn.Module activation
act_module = nn.ReLU()

# Create ARGS dict with both test cases
# We'll use the string case as the primary one
ARGS = {
    "act": act_str
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch, transformers — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
GreaseArgConfig Not yet run
unverified (harvested, no recorded run)
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("b641adcc36eab75c")
How it ran

no invocation recorded.

GreaseArgGraphTransformerLayer Not yet run
unverified (harvested, no recorded run)
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("9a71a406f45cab83")
How it ran

no invocation recorded.

GreaseArgModel Not yet run
unverified (harvested, no recorded run)
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("b27c3f11b5b30230")
How it ran

no invocation recorded.

GreaseArgMutualAttention Not yet run
unverified (harvested, no recorded run)
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("8afbb153ed089875")
How it ran

no invocation recorded.

GreaseArgPreTrainedModel Not yet run
unverified (harvested, no recorded run)
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("d9cda6476cc664ec")
How it ran

no invocation recorded.

GreaseArgTextGraphAttention Not yet run
unverified (harvested, no recorded run)
ljcleo/Hi-ArG/argsme/pretrain/model.py
code served (permissive licence) · get_code("7429bcc3694be456")
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-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

The knowledge graph is a structure to store and represent knowledge, and recent studies have discussed its capability to assist language models for various applications. Some variations of knowledge graphs aim to record arguments and their relations for computational argumentation tasks. However, many must simplify semantic types to fit specific schemas, thus losing flexibility and expression ability. In this paper, we propose the Hierarchical Argumentation Graph (Hi-ArG), a new structure to organize arguments. We also introduce two approaches to exploit Hi-ArG, including a text-graph multi-modal model GreaseArG and a new pre-training framework augmented with graph information. Experiments on two argumentation tasks have shown that after further pre-training and fine-tuning, GreaseArG supersedes same-scale language models on these tasks, while incorporating graph information during further pre-training can also improve the performance of vanilla language models. Code for this paper is available at https://github.com/ljcleo/Hi-ArG.

For agents

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

get_harvested_code_for_paper("2312.00874")
get_code_for_paper("2312.00874")
have("2312.00874")

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

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

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

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

Connect an agent — have() is free.