lamm-mit/Graph-PRefLexOR-4B-Inpainting
Graph-PRefLexOR-4B-Inpainting by lamm-mit is a 4 billion parameter model based on Google's Gemma-4-E4B-it, specifically trained to complete and repair scientific mechanism graphs. It takes a natural language condition and an incomplete or corrupted graph canvas, returning a complete, structured JSON graph. This model excels at graph inpainting, including constructing graphs from scratch, connecting fixed nodes, adding missing edges, completing subgraphs, and repairing corrupted relations or removing spurious edges.
Loading preview...
Graph-PRefLexOR-4B-Inpainting: Scientific Graph Completion and Repair
lamm-mit/Graph-PRefLexOR-4B-Inpainting is a specialized model built upon the google/gemma-4-E4B-it base, designed for the unique task of completing and repairing scientific mechanism graphs. It processes a natural language condition and an empty, incomplete, or corrupted graph canvas, outputting a fully structured JSON graph.
Key Capabilities
This model is trained to handle six distinct graph-inpainting and repair modes:
prior_empty: Constructs a complete graph from a natural language condition when given an empty canvas.fixed_nodes_only: Preserves a supplied subset of nodes and adds missing graph elements.missing_edges: Adds omitted edges to a graph with complete nodes but an incomplete edge set.partial_subgraph: Completes a graph by adding missing nodes and edges to a correct but incomplete subgraph.wrong_relations: Repairs incorrect relation labels within a graph while preserving relevant nodes and endpoints.extra_edges: Identifies and removes spurious edges that are not supported by the given condition.
Performance and Training
The model demonstrates significant improvements over its base model, google/gemma-4-E4B-it, on validation metrics for graph completion. For instance, it achieves a 0.9869 Valid completion score compared to the base model's 0.6436, and an Exact graph score of 0.1694 versus 0.0597. It was trained using Group Relative Policy Optimization (GRPO) on the lamm-mit/graph-canvas-inpainting-121k dataset, with a focus on a shaped graph-completion reward.
Output Contract
The model's output is a complete graph object in JSON format, containing nodes (with at least an id) and edges (with source, relation, and target). It ensures no duplicate nodes or edges and that all edge endpoints are present in the nodes list. The model returns the complete graph, not just a patch.
Limitations
While powerful, a schema-valid graph from the model is not guaranteed to be scientifically correct. It may omit mechanisms, introduce unsupported concepts, or choose incorrect causal relations. Outputs should always be reviewed by a domain expert, and the model is intended for research in structured scientific reasoning, not as an autonomous scientific authority.