larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse

Model

larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse

0

6 commits

1 linked in READMEs

updated Oct 11, 2026

See the code

README

Dipo logo

larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse

A pretrained generative RST parser (an end-to-end RST parser that fine-tunes a language model to generate a linearized tree (a bottom-up shift-reduce action sequence or a nested s-expression) and recovers segmentation + structure from the decoded string; the backbone (encoder-decoder or causal) and serialization are config-selected) developed and trained in Dipo.

This model uses google/gemma-4-31B-it as its underlying encoder.

Data

RST Discourse Treebank (RST-DT) (English). 385 WSJ articles from the Penn Treebank, annotated in RST with a fine-grained relation inventory. RST-DT is the traditional English benchmark for RST parsing. This model was trained on the original, untokenized EDU text of the LDC release, to match raw input.

Relation labels: Mapped from an original label inventory with 111 items to 18 labels. Mapped labels:

attribution, background, cause, comparison, condition, contrast, elaboration, enablement, evaluation, explanation, joint, manner-means, same-unit, summary, temporal, textual-organization, topic-change, topic-comment

Metrics

SplitSegE2E SpanE2E NucE2E RelE2E FullGold-EDU SpanGold-EDU NucGold-EDU RelGold-EDU Full
dev97.873.164.153.952.975.866.356.355.1
test98.175.365.656.054.777.567.657.856.5

F1 x 100 under original Parseval, with trivial leaf spans excluded. E2E scores parse trees predicted from raw text, segmentation included. Gold-EDU scores them given the gold EDU segmentation. Seg is the per-token BeginSeg F1 computed during training, which can read up to about a point below the official DISRPT scorer's value. The checkpoint was selected on dev e2e_full_f1.

Usage

Install the library first with pip install dipo.

CLI

dipo gen predict \
    --hub-id larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse \
    --text 'Although the experiment was carefully designed, the results were inconclusive. We plan to repeat it tonight.'

To parse a raw .txt file or a directory of them instead, use --text-file <path> --output-dir out/.

Python

from dipo.rst.parsers.gen.modeling_gen import GenParser

parser = GenParser.from_pretrained("larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse")
tree = parser.predict_from_text(
    "Although the experiment was carefully designed, the results were inconclusive. We plan to repeat it tonight."
)
print(tree.to_rs4_string())

Citation

If you use this model, please cite the Dipo library:

@misc{gessler-dipo-2026,
  author       = {Gessler, Luke},
  title        = {{Dipo: The Discourse Parsing Omnibus}},
  year         = {2026},
  howpublished = {\url{https://github.com/larc-iu/dipo}},
}

Notes

  • Input: Raw running text. Line breaks and other whitespace are fine, so there is no need to tokenize or clean the text first.
  • Training: Trained on the training split only, with the checkpoint chosen on the dev split. Scores are from a single training run, and run-to-run variation on small test sets can be several points.
  • Line structure: The model reads text with all whitespace collapsed, so line and paragraph breaks are not used. In our tests it still set section headings apart as their own segment.
  • Known limitation: Rarely (once in about 3,000 segments in our tests, inside a code sample) the model emits an empty segment. Filter on edu.strip() if that matters for your use.
  • Backbone: This repository holds the LoRA adapter and task heads only. The base model google/gemma-4-31B-it is downloaded from the Hub on first use, so accept its license there first where it is gated.
  • Access: The base model google/gemma-4-31B-it is gated on Hugging Face. Before the first run, open https://huggingface.co/google/gemma-4-31B-it, accept its terms, and log in with huggingface-cli login (or set HF_TOKEN). Without that, loading fails with a "gated repo" 401 error.
  • Length: A document longer than 16,384 tokens is rejected with an error rather than truncated.
  • License: Derived from google/gemma-4-31B-it, so use of these weights is subject to that model's terms: Apache 2.0.
  • Data terms: Trained on RST-DT (LDC2002T07), which the Linguistic Data Consortium distributes under its user agreement. Check that your use is permitted by it.
  • Intended use: Research and analysis of text. The weights carry the terms of the base model and of the training corpus above, and the scores on this card come from this checkpoint and not from the runs reported in the accompanying paper.

Full training configuration

See below for the full training configuration this model was trained with.

{
  "train_dir": "data/rstdt_notok/train",
  "dev_dir": "data/rstdt_notok/dev",
  "backbone": "decoder_only",
  "serialization": "sr",
  "test_dir": "data/rstdt_notok/test",
  "relation_types": [
    [
      "attribution",
      "rst"
    ],
    [
      "background",
      "rst"
    ],
    [
      "cause",
      "multinuc"
    ],
    [
      "cause",
      "rst"
    ],
    [
      "comparison",
      "multinuc"
    ],
    [
      "comparison",
      "rst"
    ],
    [
      "condition",
      "multinuc"
    ],
    [
      "condition",
      "rst"
    ],
    [
      "contrast",
      "multinuc"
    ],
    [
      "contrast",
      "rst"
    ],
    [
      "elaboration",
      "rst"
    ],
    [
      "enablement",
      "rst"
    ],
    [
      "evaluation",
      "multinuc"
    ],
    [
      "evaluation",
      "rst"
    ],
    [
      "explanation",
      "multinuc"
    ],
    [
      "explanation",
      "rst"
    ],
    [
      "joint",
      "multinuc"
    ],
    [
      "manner-means",
      "rst"
    ],
    [
      "same-unit",
      "multinuc"
    ],
    [
      "summary",
      "rst"
    ],
    [
      "temporal",
      "multinuc"
    ],
    [
      "temporal",
      "rst"
    ],
    [
      "textual-organization",
      "multinuc"
    ],
    [
      "topic-change",
      "multinuc"
    ],
    [
      "topic-change",
      "rst"
    ],
    [
      "topic-comment",
      "multinuc"
    ],
    [
      "topic-comment",
      "rst"
    ]
  ],
  "relation_map": {
    "Analogy": "comparison",
    "Cause-Result": "cause",
    "Comment-Topic": "topic-comment",
    "Comparison": "comparison",
    "Consequence": "cause",
    "Contrast": "contrast",
    "Disjunction": "joint",
    "Evaluation": "evaluation",
    "Interpretation": "evaluation",
    "Inverted-Sequence": "temporal",
    "List": "joint",
    "Otherwise": "condition",
    "Problem-Solution": "topic-comment",
    "Proportion": "comparison",
    "Question-Answer": "topic-comment",
    "Reason": "explanation",
    "Same-Unit": "same-unit",
    "Sequence": "temporal",
    "Statement-Response": "topic-comment",
    "Temporal-Same-Time": "temporal",
    "TextualOrganization": "textual-organization",
    "Topic-Comment": "topic-comment",
    "Topic-Drift": "topic-change",
    "Topic-Shift": "topic-change",
    "analogy": "comparison",
    "analogy-e": "comparison",
    "antithesis": "contrast",
    "antithesis-e": "contrast",
    "attribution": "attribution",
    "attribution-e": "attribution",
    "attribution-n": "attribution",
    "background": "background",
    "background-e": "background",
    "cause": "cause",
    "circumstance": "background",
    "circumstance-e": "background",
    "comment": "evaluation",
    "comment-e": "evaluation",
    "comparison": "comparison",
    "comparison-e": "comparison",
    "concession": "contrast",
    "concession-e": "contrast",
    "conclusion": "evaluation",
    "condition": "condition",
    "condition-e": "condition",
    "consequence-n": "cause",
    "consequence-n-e": "cause",
    "consequence-s": "cause",
    "consequence-s-e": "cause",
    "contingency": "condition",
    "definition": "elaboration",
    "definition-e": "elaboration",
    "elaboration-additional": "elaboration",
    "elaboration-additional-e": "elaboration",
    "elaboration-general-specific": "elaboration",
    "elaboration-general-specific-e": "elaboration",
    "elaboration-object-attribute": "elaboration",
    "elaboration-object-attribute-e": "elaboration",
    "elaboration-part-whole": "elaboration",
    "elaboration-part-whole-e": "elaboration",
    "elaboration-process-step": "elaboration",
    "elaboration-process-step-e": "elaboration",
    "elaboration-set-member": "elaboration",
    "elaboration-set-member-e": "elaboration",
    "enablement": "enablement",
    "enablement-e": "enablement",
    "evaluation-n": "evaluation",
    "evaluation-s": "evaluation",
    "evaluation-s-e": "evaluation",
    "evidence": "explanation",
    "evidence-e": "explanation",
    "example": "elaboration",
    "example-e": "elaboration",
    "explanation-argumentative": "explanation",
    "explanation-argumentative-e": "explanation",
    "hypothetical": "condition",
    "interpretation-n": "evaluation",
    "interpretation-s": "evaluation",
    "interpretation-s-e": "evaluation",
    "manner": "manner-means",
    "manner-e": "manner-means",
    "means": "manner-means",
    "means-e": "manner-means",
    "otherwise": "condition",
    "preference": "comparison",
    "preference-e": "comparison",
    "problem-solution-n": "topic-comment",
    "problem-solution-s": "topic-comment",
    "purpose": "enablement",
    "purpose-e": "enablement",
    "question-answer-n": "topic-comment",
    "question-answer-s": "topic-comment",
    "reason": "explanation",
    "reason-e": "explanation",
    "restatement": "summary",
    "restatement-e": "summary",
    "result": "cause",
    "result-e": "cause",
    "rhetorical-question": "topic-comment",
    "statement-response-n": "topic-comment",
    "statement-response-s": "topic-comment",
    "summary-n": "summary",
    "summary-s": "summary",
    "temporal-after": "temporal",
    "temporal-after-e": "temporal",
    "temporal-before": "temporal",
    "temporal-before-e": "temporal",
    "temporal-same-time": "temporal",
    "temporal-same-time-e": "temporal",
    "topic-drift": "topic-change",
    "topic-shift": "topic-change"
  },
  "model_name": "google/gemma-4-31B-it",
  "max_input_length": 16384,
  "max_output_length": 16384,
  "gradient_checkpointing": true,
  "peft": {
    "r": 16,
    "alpha": 32,
    "dropout": 0.1,
    "target_modules": "^(?!.*vision_tower)(?!.*audio_tower).*\\.(q_proj|k_proj|v_proj|o_proj|gate_proj|up_proj|down_proj)$",
    "bias": "none",
    "dora": false,
    "modules_to_save": [
      "embed_tokens"
    ],
    "train_only_new_embedding_rows": true,
    "base_dtype": "float32",
    "gradient_checkpointing": false,
    "load_in_4bit": false,
    "bnb_4bit_quant_type": "nf4",
    "bnb_4bit_use_double_quant": true,
    "bnb_4bit_compute_dtype": "bfloat16"
  },
  "chat_template": null,
  "curriculum": {
    "type": "subtree_size",
    "size_schedule": [
      8,
      16,
      32,
      64,
      null
    ],
    "phase_epochs": [
      8,
      4,
      4,
      4,
      40
    ],
    "max_epoch_expand_factor": 2
  },
  "lr": 0.0003,
  "new_row_lr": null,
  "weight_decay": 0.05,
  "batch_size": 1,
  "grad_accum": 8,
  "optimizer": "adafactor",
  "num_warmup_steps": null,
  "min_lr_frac": 0.1,
  "fulldoc_warmup_steps": 150,
  "max_grad_norm": 1,
  "amp": true,
  "patience": 5,
  "patience_window": 1,
  "log_every": 5,
  "begin_validation_epoch": 0,
  "validate_every": 2,
  "checkpoint_trainable_only": true,
  "run_name": "release-gen-sr-gemma4-31b-rstdt",
  "seed": 42,
  "val_metric_name": "e2e_full_f1",
  "num_beams": 1,
  "eval_decode_greedy": true,
  "min_edu_length": 1,
  "dev_max_docs": null,
  "dev_batch_size": 2,
  "batched_decode": true,
  "action_loss_weight": 1,
  "width_band_loss": null,
  "edu_loss_weight_exponent": 0,
  "label_smoothing": 0.1,
  "traversal_order": "postorder",
  "use_copy": true,
  "label_style": "token"
}
dipo
discourse-parsing

larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse

Model

larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse

0

6 commits

1 linked in READMEs

updated Oct 11, 2026

See the code

README

Dipo logo

larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse

A pretrained generative RST parser (an end-to-end RST parser that fine-tunes a language model to generate a linearized tree (a bottom-up shift-reduce action sequence or a nested s-expression) and recovers segmentation + structure from the decoded string; the backbone (encoder-decoder or causal) and serialization are config-selected) developed and trained in Dipo.

This model uses google/gemma-4-31B-it as its underlying encoder.

Data

RST Discourse Treebank (RST-DT) (English). 385 WSJ articles from the Penn Treebank, annotated in RST with a fine-grained relation inventory. RST-DT is the traditional English benchmark for RST parsing. This model was trained on the original, untokenized EDU text of the LDC release, to match raw input.

Relation labels: Mapped from an original label inventory with 111 items to 18 labels. Mapped labels:

attribution, background, cause, comparison, condition, contrast, elaboration, enablement, evaluation, explanation, joint, manner-means, same-unit, summary, temporal, textual-organization, topic-change, topic-comment

Metrics

SplitSegE2E SpanE2E NucE2E RelE2E FullGold-EDU SpanGold-EDU NucGold-EDU RelGold-EDU Full
dev97.873.164.153.952.975.866.356.355.1
test98.175.365.656.054.777.567.657.856.5

F1 x 100 under original Parseval, with trivial leaf spans excluded. E2E scores parse trees predicted from raw text, segmentation included. Gold-EDU scores them given the gold EDU segmentation. Seg is the per-token BeginSeg F1 computed during training, which can read up to about a point below the official DISRPT scorer's value. The checkpoint was selected on dev e2e_full_f1.

Usage

Install the library first with pip install dipo.

CLI

dipo gen predict \
    --hub-id larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse \
    --text 'Although the experiment was carefully designed, the results were inconclusive. We plan to repeat it tonight.'

To parse a raw .txt file or a directory of them instead, use --text-file <path> --output-dir out/.

Python

from dipo.rst.parsers.gen.modeling_gen import GenParser

parser = GenParser.from_pretrained("larc-iu/gen-sr-gemma-4-31b-it-rstdt-coarse")
tree = parser.predict_from_text(
    "Although the experiment was carefully designed, the results were inconclusive. We plan to repeat it tonight."
)
print(tree.to_rs4_string())

Citation

If you use this model, please cite the Dipo library:

@misc{gessler-dipo-2026,
  author       = {Gessler, Luke},
  title        = {{Dipo: The Discourse Parsing Omnibus}},
  year         = {2026},
  howpublished = {\url{https://github.com/larc-iu/dipo}},
}

Notes

  • Input: Raw running text. Line breaks and other whitespace are fine, so there is no need to tokenize or clean the text first.
  • Training: Trained on the training split only, with the checkpoint chosen on the dev split. Scores are from a single training run, and run-to-run variation on small test sets can be several points.
  • Line structure: The model reads text with all whitespace collapsed, so line and paragraph breaks are not used. In our tests it still set section headings apart as their own segment.
  • Known limitation: Rarely (once in about 3,000 segments in our tests, inside a code sample) the model emits an empty segment. Filter on edu.strip() if that matters for your use.
  • Backbone: This repository holds the LoRA adapter and task heads only. The base model google/gemma-4-31B-it is downloaded from the Hub on first use, so accept its license there first where it is gated.
  • Access: The base model google/gemma-4-31B-it is gated on Hugging Face. Before the first run, open https://huggingface.co/google/gemma-4-31B-it, accept its terms, and log in with huggingface-cli login (or set HF_TOKEN). Without that, loading fails with a "gated repo" 401 error.
  • Length: A document longer than 16,384 tokens is rejected with an error rather than truncated.
  • License: Derived from google/gemma-4-31B-it, so use of these weights is subject to that model's terms: Apache 2.0.
  • Data terms: Trained on RST-DT (LDC2002T07), which the Linguistic Data Consortium distributes under its user agreement. Check that your use is permitted by it.
  • Intended use: Research and analysis of text. The weights carry the terms of the base model and of the training corpus above, and the scores on this card come from this checkpoint and not from the runs reported in the accompanying paper.

Full training configuration

See below for the full training configuration this model was trained with.

{
  "train_dir": "data/rstdt_notok/train",
  "dev_dir": "data/rstdt_notok/dev",
  "backbone": "decoder_only",
  "serialization": "sr",
  "test_dir": "data/rstdt_notok/test",
  "relation_types": [
    [
      "attribution",
      "rst"
    ],
    [
      "background",
      "rst"
    ],
    [
      "cause",
      "multinuc"
    ],
    [
      "cause",
      "rst"
    ],
    [
      "comparison",
      "multinuc"
    ],
    [
      "comparison",
      "rst"
    ],
    [
      "condition",
      "multinuc"
    ],
    [
      "condition",
      "rst"
    ],
    [
      "contrast",
      "multinuc"
    ],
    [
      "contrast",
      "rst"
    ],
    [
      "elaboration",
      "rst"
    ],
    [
      "enablement",
      "rst"
    ],
    [
      "evaluation",
      "multinuc"
    ],
    [
      "evaluation",
      "rst"
    ],
    [
      "explanation",
      "multinuc"
    ],
    [
      "explanation",
      "rst"
    ],
    [
      "joint",
      "multinuc"
    ],
    [
      "manner-means",
      "rst"
    ],
    [
      "same-unit",
      "multinuc"
    ],
    [
      "summary",
      "rst"
    ],
    [
      "temporal",
      "multinuc"
    ],
    [
      "temporal",
      "rst"
    ],
    [
      "textual-organization",
      "multinuc"
    ],
    [
      "topic-change",
      "multinuc"
    ],
    [
      "topic-change",
      "rst"
    ],
    [
      "topic-comment",
      "multinuc"
    ],
    [
      "topic-comment",
      "rst"
    ]
  ],
  "relation_map": {
    "Analogy": "comparison",
    "Cause-Result": "cause",
    "Comment-Topic": "topic-comment",
    "Comparison": "comparison",
    "Consequence": "cause",
    "Contrast": "contrast",
    "Disjunction": "joint",
    "Evaluation": "evaluation",
    "Interpretation": "evaluation",
    "Inverted-Sequence": "temporal",
    "List": "joint",
    "Otherwise": "condition",
    "Problem-Solution": "topic-comment",
    "Proportion": "comparison",
    "Question-Answer": "topic-comment",
    "Reason": "explanation",
    "Same-Unit": "same-unit",
    "Sequence": "temporal",
    "Statement-Response": "topic-comment",
    "Temporal-Same-Time": "temporal",
    "TextualOrganization": "textual-organization",
    "Topic-Comment": "topic-comment",
    "Topic-Drift": "topic-change",
    "Topic-Shift": "topic-change",
    "analogy": "comparison",
    "analogy-e": "comparison",
    "antithesis": "contrast",
    "antithesis-e": "contrast",
    "attribution": "attribution",
    "attribution-e": "attribution",
    "attribution-n": "attribution",
    "background": "background",
    "background-e": "background",
    "cause": "cause",
    "circumstance": "background",
    "circumstance-e": "background",
    "comment": "evaluation",
    "comment-e": "evaluation",
    "comparison": "comparison",
    "comparison-e": "comparison",
    "concession": "contrast",
    "concession-e": "contrast",
    "conclusion": "evaluation",
    "condition": "condition",
    "condition-e": "condition",
    "consequence-n": "cause",
    "consequence-n-e": "cause",
    "consequence-s": "cause",
    "consequence-s-e": "cause",
    "contingency": "condition",
    "definition": "elaboration",
    "definition-e": "elaboration",
    "elaboration-additional": "elaboration",
    "elaboration-additional-e": "elaboration",
    "elaboration-general-specific": "elaboration",
    "elaboration-general-specific-e": "elaboration",
    "elaboration-object-attribute": "elaboration",
    "elaboration-object-attribute-e": "elaboration",
    "elaboration-part-whole": "elaboration",
    "elaboration-part-whole-e": "elaboration",
    "elaboration-process-step": "elaboration",
    "elaboration-process-step-e": "elaboration",
    "elaboration-set-member": "elaboration",
    "elaboration-set-member-e": "elaboration",
    "enablement": "enablement",
    "enablement-e": "enablement",
    "evaluation-n": "evaluation",
    "evaluation-s": "evaluation",
    "evaluation-s-e": "evaluation",
    "evidence": "explanation",
    "evidence-e": "explanation",
    "example": "elaboration",
    "example-e": "elaboration",
    "explanation-argumentative": "explanation",
    "explanation-argumentative-e": "explanation",
    "hypothetical": "condition",
    "interpretation-n": "evaluation",
    "interpretation-s": "evaluation",
    "interpretation-s-e": "evaluation",
    "manner": "manner-means",
    "manner-e": "manner-means",
    "means": "manner-means",
    "means-e": "manner-means",
    "otherwise": "condition",
    "preference": "comparison",
    "preference-e": "comparison",
    "problem-solution-n": "topic-comment",
    "problem-solution-s": "topic-comment",
    "purpose": "enablement",
    "purpose-e": "enablement",
    "question-answer-n": "topic-comment",
    "question-answer-s": "topic-comment",
    "reason": "explanation",
    "reason-e": "explanation",
    "restatement": "summary",
    "restatement-e": "summary",
    "result": "cause",
    "result-e": "cause",
    "rhetorical-question": "topic-comment",
    "statement-response-n": "topic-comment",
    "statement-response-s": "topic-comment",
    "summary-n": "summary",
    "summary-s": "summary",
    "temporal-after": "temporal",
    "temporal-after-e": "temporal",
    "temporal-before": "temporal",
    "temporal-before-e": "temporal",
    "temporal-same-time": "temporal",
    "temporal-same-time-e": "temporal",
    "topic-drift": "topic-change",
    "topic-shift": "topic-change"
  },
  "model_name": "google/gemma-4-31B-it",
  "max_input_length": 16384,
  "max_output_length": 16384,
  "gradient_checkpointing": true,
  "peft": {
    "r": 16,
    "alpha": 32,
    "dropout": 0.1,
    "target_modules": "^(?!.*vision_tower)(?!.*audio_tower).*\\.(q_proj|k_proj|v_proj|o_proj|gate_proj|up_proj|down_proj)$",
    "bias": "none",
    "dora": false,
    "modules_to_save": [
      "embed_tokens"
    ],
    "train_only_new_embedding_rows": true,
    "base_dtype": "float32",
    "gradient_checkpointing": false,
    "load_in_4bit": false,
    "bnb_4bit_quant_type": "nf4",
    "bnb_4bit_use_double_quant": true,
    "bnb_4bit_compute_dtype": "bfloat16"
  },
  "chat_template": null,
  "curriculum": {
    "type": "subtree_size",
    "size_schedule": [
      8,
      16,
      32,
      64,
      null
    ],
    "phase_epochs": [
      8,
      4,
      4,
      4,
      40
    ],
    "max_epoch_expand_factor": 2
  },
  "lr": 0.0003,
  "new_row_lr": null,
  "weight_decay": 0.05,
  "batch_size": 1,
  "grad_accum": 8,
  "optimizer": "adafactor",
  "num_warmup_steps": null,
  "min_lr_frac": 0.1,
  "fulldoc_warmup_steps": 150,
  "max_grad_norm": 1,
  "amp": true,
  "patience": 5,
  "patience_window": 1,
  "log_every": 5,
  "begin_validation_epoch": 0,
  "validate_every": 2,
  "checkpoint_trainable_only": true,
  "run_name": "release-gen-sr-gemma4-31b-rstdt",
  "seed": 42,
  "val_metric_name": "e2e_full_f1",
  "num_beams": 1,
  "eval_decode_greedy": true,
  "min_edu_length": 1,
  "dev_max_docs": null,
  "dev_batch_size": 2,
  "batched_decode": true,
  "action_loss_weight": 1,
  "width_band_loss": null,
  "edu_loss_weight_exponent": 0,
  "label_smoothing": 0.1,
  "traversal_order": "postorder",
  "use_copy": true,
  "label_style": "token"
}
dipo
discourse-parsing