Source-linked AI summary

Relational Task Generation Language: A Declarative Specification Framework for Relational Deep Learning

Oleksii Kolesnichenko, Jakub Peleška, Gustav Šír

arXiv:2609.01292v1cs.PLcs.DBcs.LG

TL;DR

Manually defining RDL prediction tasks is laborious and frequently causes temporal leakage. RTGL is an open-source declarative language that abstracts low-level SQL for task formulation. Reconstructing benchmarks exposed temporal inconsistencies, while generated novel tasks produced structurally valid data for successful downstream RDL training.

  • Problem

    Manual RDL task creation requires complex time-aware SQL and frequently results in temporal data leakage.

  • Method

    RTGL declaratively specifies RDL prediction tasks and generates training data while integrating with open-source RDL ecosystems.

  • Results

    RTGL reconstruction uncovered temporal inconsistencies in official benchmark definitions, and RTGL-generated novel tasks supported successful downstream RDL model training.

  • Takeaways & Limitations

    RTGL provides an open-source framework for simplifying predictive task formulation and supporting structurally valid RDL tasks.

  • Takeaways & Limitations

    RTGL does not natively support distant multi-hop table interactions without intermediate views, and massive-dataset processing needs optimization.

Abstract

from arXiv · show

Relational Deep Learning (RDL) has become a powerful paradigm for learning from multi-tabular data. However, manually defining RDL prediction tasks is a laborious process that frequently results in data leakage. To address this issue, we introduce Relational Task Generation Language (RTGL) - an open-source declarative language that streamlines RDL task formulation by abstracting away low-level SQL details. We showcase RTGL by reconstructing existing RDL benchmark tasks and uncovering their inconsistencies stemming from manually crafted SQL definitions of RDL prediction targets, thereby underscoring the value of a dedicated declarative language. In addition, we demonstrate the practical utility of RTGL by designing various new tasks with diverse forms and target types. Our experiments confirm the robustness and usability of RTGL, as well as its seamless integration with the existing RDL frameworks, making it widely accessible to the community.

1 Introduction

Relational Deep Learning handles multi-table data directly, but defining precise, time-safe prediction tasks remains laborious and error-prone. RTGL addresses this bottleneck with an open-source declarative language compatible with existing RDL ecosystems.

  • Relational databases fragment structured data across interrelated tables, making manual joins and aggregations time-consuming and information-losing.
  • RDL represents entire databases as temporal heterogeneous graphs whose nodes are table rows and whose edges encode foreign-key relationships.
  • Precisely defining RDL targets requires complex time-aware SQL that enforces historical cutoffs, yet manual task construction frequently causes temporal leakage.
  • PQL simplifies RDL task generation but is proprietary, closed-source, and embedded in a commercial platform.
  • RTGL is an open-source declarative language designed to integrate with open-source RDL frameworks such as RelBench and ReDeLEx.
  • RTGL defines complex temporal tasks in a few lines, reconstructs benchmark tasks to expose SQL inconsistencies, and supports diverse new tasks in ReDeLEx.

2 Related Work

RDL extends learning beyond flat tables, while standardized ecosystems support relational benchmarking and chronological evaluation. RTGL is positioned as an open-source task-generation alternative within this broader movement.

  • Flat-table tabular methods and in-database ML remain constrained by requiring single, denormalized input tables.
  • RDL combines relational structure with tabular and graph representation learning, graph transformers, and large language models.
  • RDL research is moving toward foundation models supported by task-agnostic pretraining and synthetic data generation.
  • RelBench and ReDeLEx formalize predictive tasks with chronological splits and evaluation across diverse databases to analyze structural effects.

3 Relational Deep Learning

RDL interprets relational databases as temporal heterogeneous graphs and formulates prediction instances around target entities, labels, and anchor times. Static tasks use fixed snapshots, whereas temporal tasks require strict historical masking.

  • RDL interprets a relational database as a heterogeneous graph, enabling graph neural networks and tabular representation learning on native database structures.
  • A relational database consists of relations represented as tables, with attributes, tuples, primary keys, foreign keys, features, and optional timestamps.
  • 3.1 Graph Representation: The relational entity graph maps table rows to nodes and primary-key/foreign-key relationships to edges, with functions encoding node types, edge types, and timestamps.
  • RDL models encode table attributes, refine embeddings with tabular models, perform graph message passing, and map final embeddings to predictions.
  • 3.3 Predictive Tasks: Each predictive task instance contains a target entity v, label y, and anchor time t in a dedicated task table.
  • Static tasks predict masked properties from a fixed graph snapshot without a temporal dimension.
  • 3.3 Predictive Tasks: Temporal tasks predict future-window outcomes while conditioning the model on a graph masked to information available at or before the anchor time.

4 Relational Task Generation Language

RTGL declaratively specifies RDL prediction targets, entities, and time contexts, then supports scalar and set-valued task outputs across static and temporal settings. Its temporal constructs distinguish future prediction windows from historical observation windows.

  • RTGL is declarative, temporally safe, open-source, and applicable to classification, regression, and link prediction.
  • RTGL expresses each task by specifying what to predict, the entity involved, and the temporally safe historical and future context.
  • PREDICT defines the target label through aggregations, conditions, or static column references, with temporal features restricted to a future window.
  • FOR EACH identifies the primary entity table and identifier that determine the prediction grain and map outputs to graph nodes.
  • Temporal aggregations require explicit start and end shifts, making the chronological bounds of operations part of the task specification.
  • ASSUMING filters future events, whereas WHERE selects instances using historical conditions relative to the anchor timestamp.
  • LIST_DISTINCT returns sets of distinct categorical entities or foreign keys for multilabel classification and link prediction.

5 Internal Design and Implementation

RTGL converts declarative queries into executable relational logic through parsing, semantic validation, and relational-algebra-based conversion. Its task definitions include structured predictive objectives and support recreating benchmark tasks such as rel-f1 driver-top3.

  • Pipeline architecture: RTGL operates on a raw query, relational database schema, and optional anchor timestamps through parsing, validation, and conversion stages.The pipeline is designed to translate declarative syntax into executable SQL while preserving semantic and chronological correctness.
  • Parsing and AST generation: ANTLR4 parses raw query strings into concrete syntax trees, while a Visitor traversal produces standardized abstract syntax trees for downstream logic.The AST is represented as a nested dictionary that separates text parsing from deeper logical operations.
  • Semantic validation: Semantic validation checks referenced tables and columns, primary and foreign key constraints, and type correctness against the relational schema.Validation occurs after AST generation and before data extraction or execution.
  • Relational conversion: The converter recursively unwraps AST expressions into isolated relational-algebra subtables and combines them with operations such as SQL INTERSECT for boolean AND conditions.This avoids generating one massive SQL statement and preserves modular logical construction.

6 Validation and Experiments

RTGL was validated by recreating RelBench tasks, exposing temporal inconsistencies, generating diverse ReDeLEx tasks, and training RDL models on the resulting tables.

  • 6.1 Recreated Tasks: RTGL regenerated most standard RelBench predictive tasks using simple declarative statements.
  • 6.1 Recreated Tasks: Direct comparison with RelBench reference tables was used to verify equivalence for correctly formulated tasks, although deeply nested multi-hop tasks require intermediate database views.
  • 6.2 Found Inconsistencies: RTGL revealed logical and structural errors in official RelBench SQL tasks, where original tables sometimes contained more rows than temporally sound RTGL tables.
  • 6.2 Found Inconsistencies: Missing upper-bound time constraints in driver-dnf allowed future driver activity and drivers not yet present at prediction time into the query results.
  • 6.3 New Tasks: RTGL generated novel ctu-seznam tasks spanning binary, multiclass, multilabel classification, and regression.
  • 6.4 Results: GraphSAGE and HGT models showed predictive capability and consistent training improvement across diverse tasks, with GraphSAGE frequently surpassing HGT.

7 Conclusion

RTGL simplifies temporal predictive-task formulation, exposes inconsistencies in manually defined benchmarks, and supports valid novel-task data for downstream RDL training. Remaining limitations concern multi-hop table interactions and processing speed on massive datasets.

  • RTGL abstracts low-level SQL logic to simplify temporal predictive-task formulation in relational deep learning.
  • Using RTGL to regenerate standard benchmarks uncovered temporal inconsistencies in official manually constructed task definitions.
  • RTGL generated valid structural data for novel tasks, enabling successful training of downstream RDL models.
  • Native support for interactions between distant tables across multi-hop connections remains a future syntax extension.The proposed extension would avoid requiring intermediate views.
  • Performance optimization remains necessary to accelerate processing for massive enterprise datasets.

A.1 Experiment Details

Experiments used matched architectural complexity for GraphSAGE and HGT, followed by a shared MLP prediction head and common optimization settings.

  • GraphSAGE and HGT used hidden representations of 128 channels to yield similar architectural complexity.
  • A shared MLP head used 256 hidden units, ReLU, layer normalization, and dropout after graph message passing.
  • All experiments used AdamW with a learning rate of 0.0005 and batch size 256.
  • Training ran for up to 30 epochs.

A.2 Additional RTGL Tasks

The rel-stack appendix recreates RelBench tasks, including a user-engagement binary classification task predicting near-term user activity.

  • RTGL recreated tasks from the rel-stack dataset in the RelBench benchmark.
  • The rel-stack user-engagement task is a binary classification problem for each user.
  • The task predicts whether a user will make any votes, posts, or comments in the next 3 months.
  • Figure 6 presents recreated rel-stack dataset tasks from the RelBench benchmark.
Loading 2609.01292v1…