Manuscript Offprint
arXiv:2610.12742U4RASD at KnowledgeGraphEval-2026: Ontology-Constrained Encoder and LLM Systems for Arabic Relation Extraction
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Abstract
This paper details our submission to KnowledgeGraphEval 2026 Subtask 2 on directed Arabic relation extraction. We explored encoder-based and large language model approaches for predicting one of 40 relations or no_relation from an Arabic sentence and a subject-object pair. Our encoder systems use typed entity markers and separate relation-existence and relation-classification heads, while our LLM systems fine-tune Yehia and Qwen3.5 with QLoRA and ontology-constrained prediction. Our best system, an ensemble of Yehia-RE, Qwen-RE, and TypedPair, achieved a micro-F1 score of 94.06 and ranked 1st in Subtask 2. Yehia-RE (full-vocabulary) achieved 92.98, while the best encoder and Qwen-RE achieved 92.69 and 91.94 respectively. Our results highlight the importance of constrained prediction and complementary modeling approaches for Arabic relation extraction.
1 Introduction
Relation Extraction (RE) is an information extraction task that aims to identify semantic relations between entities mentioned in text. In directed RE, the relation is predicted from a designated subject to a designated object. Arabic RE remains challenging when relations are semantically similar, entity mentions occur multiple times in the same sentence, or entity-type information is needed to determine which relations are valid.
In this paper, we present our submission to KnowledgeGraphEval 2026 Subtask 2 on directed Arabic relation extraction. Given an Arabic sentence and a subject-object pair, the task is to predict one of 40 positive relations or no_relation when no valid relation is expressed (Aljabari et al., 2026). The task data are also highly imbalanced, making accurate positive-relation prediction and no_relation handling particularly important.
We investigate two system families. The first, TypedPair, uses Arabic encoder models with typed directional entity markers and separate heads for relation existence and positive-relation classification. The second uses Yehia (Navid-AI, 2025) and Qwen3.5 (Qwen Team, 2026), adapted with QLoRA (Dettmers et al., 2023), resulting in our Yehia-RE and Qwen-RE systems. Yehia-RE formulates relation prediction as a constrained Arabic one-token multiple-choice task, while Qwen-RE is evaluated using both causal-LM prediction and sequence classification. All systems share entity-occurrence resolution, entity-type prediction, and ontology-based relation filtering.
Our main contributions are: (1) the TypedPair encoder family; (2) ontology-constrained Yehia-RE and Qwen-RE systems; and (3) a shared pipeline for occurrence resolution, entity typing, and relation filtering. Our best ensemble achieved a micro- score of 94.06 and ranked 1st in Subtask 2. The strongest individual Yehia-RE, TypedPair, and Qwen-RE systems achieved 92.98, 92.69, and 91.94, respectively. The trained models and released resources are available at https://huggingface.co/U4RASD.
Prior relation-extraction work has explored marker-based encoder models, including entity markers (Baldini Soares et al., 2019), PL-Marker (Ye et al., 2022), and typed entity markers (Zhou and Chen, 2022). For Arabic RE, Wojood introduces NLI-RE, which formulates candidate relations as natural-language-inference hypotheses and filters them according to compatible entity types (Aljabari et al., 2025b).
Generative approaches have also modeled RE through sequence generation and prompting. AREEj augments Arabic relation extraction with textual evidence supervision (Rakan Al Mraikhat et al., 2024), while GPT-RE and related work explore in-context and instruction-based relation prediction (Wan et al., 2023; Wadhwa et al., 2023; Zhang et al., 2023). Our work investigates both encoder-based and constrained LLM-based approaches under the same ontology-aware Arabic RE setting.
3 System Overview
Figure 1 summarizes the shared full pipeline and the two model families. The following subsections summarize the components that distinguish the submitted systems.
3.1 Shared Pipeline
The input provides the subject and object strings, but repeated occurrences may require resolving which mentions should be evaluated, and entity types are not directly provided to the relation models. We therefore locate all exact subject and object occurrences and construct the possible directed occurrence pairs. Each occurrence is then assigned an entity type using our TypePredictor, and the predicted types are used both in the typed entity markers and to restrict the candidate relations according to WojoodOntology. When multiple occurrence pairs are possible, the system applies a row-level decision strategy to select or combine their predictions. TypePredictor and candidate-pair handling are detailed in Appendices B and C.
3.2 Encoder-Based Systems
The TypedPair family inserts typed directional markers around the selected subject and object occurrences. It combines the sentence-start state, the two opening-marker states, simple pair interactions, and a 42-dimensional subject-object type vector. A multilayer perceptron feeds two heads: a binary head predicts whether a positive relation exists, and a 40-way head selects the positive relation. Negative rows supervise only the existence head, avoiding an arbitrary positive-class target. At inference, the positive head is masked by the predicted type pair and is consulted only when the existence score passes a validation-selected threshold.
We evaluate NeoAraBERT (Abou Chakra et al., 2026), AraBERTv02 (Antoun et al., 2020), ARBERTv2 (Elmadany et al., 2023), AraBERTv02-Large (Antoun et al., 2020), and AraModernBERT (Elshehy et al., 2026) backbones, together with various row-level candidate-pair decision strategies. The exact representation, loss, threshold selection, tensor dimensions, and candidate algorithms are provided in Appendix D.
3.3 LLM-Based Systems
3.3.1 Yehia-RE
We fine-tune Yehia with QLoRA and formulate each relation decision as a row-specific Arabic multiple-choice problem. The marked sentence, predicted entity types, and only the ontology-compatible positive relations are shown in the prompt, followed by no_relation. Each displayed option is mapped to an existing Arabic one-token code, and the model returns the code alone.
We evaluate two Yehia-RE training variants. The full-vocabulary variant optimizes the gold code against the complete model vocabulary and, at inference, compares only the displayed option codes. The row-local variant instead normalizes the training objective only over the option codes displayed for the current example. Full objectives and candidate-pair aggregation are detailed in Appendix E.
3.3.2 Qwen-RE
We fine-tune Qwen3.5-4B and Qwen3.5-9B with QLoRA using prompts containing the marked Arabic sentence, entity strings and types, and concise meanings for the ontology-compatible labels. We denote the causal-LM variants as QwenRE-4B and Qwen-RE-9B, and the 9B sequence-classification variant as Qwen-RE-9B-Cls. The markers identify the entity occurrences in the sentence and make the subject-object direction explicit. The causal-LM systems are trained to produce the relation label. At inference, we either generate the label or append each compatible label and score it using its mean token log-probability. Because the output label set is fixed, we additionally fine-tune Qwen3.5-9B with a trainable 41-way sequence-classification head. This classifier receives a shorter prompt and directly predicts a relation class, with ontology-incompatible classes masked during both training and inference, avoiding textual generation and parsing failures.

Figure 1: Shared relation-extraction pipeline and the two model families.
The Qwen prompt structures, a paired causal-LM/classifier example, complete-label scoring, class-imbalance interventions, and training configuration appear in Appendix F. We also tested manual disambiguation rules and GEPA prompt evolution (Agrawal et al., 2026); these exploratory interventions did not replace the selected submitted configurations and are documented separately in Appendix G.
4 Experimental Setup
4.1 Data and Preprocessing
The labeled training data were enriched with occurrence-specific character spans and entity types. We first aligned relation mentions with the Wojood flat and nested NER annotations (Jarrar et al., 2022); unresolved mentions were then matched against predictions from the Wojood NER model. Two authors manually resolved the remaining 240 training rows that could not be enriched automatically, retaining the original relation labels. This enrichment was used only for training; blind-test rows were processed entirely by the full inference pipeline. Conflict filtering, ontology compatibility filtering, and deduplication reduced 17,381 raw relation rows to 15,686 training instances; the development artifact contains 1,687 rows, while the official blind evaluation input contains 2,074 rows. The development artifact contains both positive relations and no_relation examples, whereas the official blind evaluation input contains only positive-relation rows; the resulting difference in class distribution means development and blind micro- scores are not directly comparable. Complete processing details are given in Appendix A.
The processed training distribution is strongly imbalanced: no_relation has 6,677 examples, followed by Location.located_in with 4,269 and PartOf.geopolitical_division with 1,684. Encoder models use cross-entropy objectives, Yehia-RE uses frequency-based sampling, the Qwen-RE causal-LM experiments use clipped inverse-frequency weighting, and the Qwen-RE classifier uses square-root inverse-frequency sampling. Selected relation-frequency statistics are reported in Appendix A, while model-specific sampling and weighting details are reported in Appendices D, E, and F.
4.2 Training, Decoding, and Selection
A cross-system summary of the principal training and selection configurations is provided in Table 21 in Appendix I. TypePredictor and TypedPair encoders are fully fine-tuned. Yehia and Qwen use 4-bit NF4 QLoRA with frozen base weights. Marker handling after tokenization follows the procedure described in Appendix C. Relation-extraction checkpoints are selected using the 1,687-row development artifact and then frozen before official inference. Fixed runner settings are reported separately in the corresponding system appendices. TypePredictor is selected independently using its entity-typing validation split.
Efficiency. AraBERTv02-Large TypedPair required approximately 43 minutes on a single NVIDIA A40, while Yehia-RE required approximately 3.32 hours on a single NVIDIA L40S. Qwen-RE-9B required approximately 12 hours on a single NVIDIA RTX PRO 4500. Since these measurements were obtained on different GPUs, they should not be treated as a controlled efficiency comparison, but they illustrate the substantially higher training cost of the LLM-based systems relative to the encoder-based model.
Official evaluation uses micro- . Depending on the configuration, the row-level deci-sion uses either majority voting, top-existence/top-confidence selection, max-positive selection, or nearest-candidate selection. Detailed definitions and deterministic tie-breaking are provided in Appendices C, D, E, and F.
5 Results
Table 1 summarizes representative official submissions. All values are full-pipeline scores on the blind set; post-submission prompt analyses are reported separately in Appendix G. The shared task permitted up to 30 official submissions per team; we used 22.
5.1 Encoder Results
Across the official blind submissions, AraModernBERT achieved the strongest encoder result at 92.69, compared with 91.96 for ARBERTv2 and 92.20–92.29 for the two reported AraBERTv02-Large aggregation strategies. NeoAraBERT with majority + logit-sum obtained 88.33. A component ablation on AraModernBERT (Appendix D.6) shows that the complete configuration with both typed text markers and the directional type vector achieved the strongest performance among the tested variants. The complete encoder and aggregation results are reported in Appendix D.5.
5.2 LLM Results
Yehia-RE (full-vocabulary) achieved 92.98, while the row-local variant reached 92.84 with max-positive aggregation. Its constrained one-token formulation eliminates free-form label formatting errors by casting relation prediction as a row-specific Arabic multiple-choice task. Our best system, a three-system majority ensemble of Yehia-RE, Qwen-RE, and TypedPair, achieved 94.06 and ranked 1st in Subtask 2. Detailed Yehia-RE formulations, candidate aggregation, and official results are provided in Appendix E.
On the official blind evaluation, Qwen-RE-4B and Qwen-RE-9B obtained 91.53 and 91.76, respectively, while Qwen-RE-9B-Cls obtained 91.94. These blind-set differences are reported descriptively rather than as controlled ablations. Complete official Qwen results are reported in Appendix F.8.
5.3 Error Analysis
The main failure modes reflect interactions among pipeline components. A type error can change the typed markers and remove the correct relation from the compatible set. Repeated surface forms can associate the prediction with the wrong textual evidence. Semantically close relations, especially generic location versus headquarters or administrative division, are difficult under a highly skewed label distribution. Finally, causal-generation systems may understand the relation but emit an invalid or partial canonical label. Additional qualitative error analysis is provided in Appendix H, while the exploratory disambiguation experiments are reported in Appendix G.
6 Conclusion
We presented two complementary system families for KnowledgeGraphEval 2026 Arabic relation extraction. The encoder family combines typed directional markers with a two-head relation objective, while the LLM family constrains Yehia-RE and Qwen-RE to ontology-compatible decisions. Our best system, an ensemble of Yehia-RE, Qwen-RE, and TypedPair, achieved an official micro- score of 94.06 and ranked 1st in Subtask 2. Yehia-RE (full-vocabulary) achieved 92.98, while the strongest encoder and Qwen-RE systems reached 92.69 and 91.94, respectively. The results highlight the importance of constrained prediction, entity-type compatibility, candidate resolution, and complementary modeling approaches. Future work will propagate type uncertainty, jointly score occurrence and relation hypotheses, and study confidence-weighted ensembles.
Limitations
The reported training-level results are based on a single random seed. Consequently, small differences between model configurations should be interpreted cautiously, as we cannot quantify variation across training runs. The systems also depend on hard entity-type predictions and exact-match occurrence recovery, and they remain challenging for rare or semantically adjacent relations. Because the TypePredictor dataset uses a mention-level split, sentence-level overlap with relation-extraction inputs is possible. Although TypePredictor never uses relation labels, such overlap may affect the entity-type predictions used for typed markers and ontology filtering.
| System | Training/decoder | Row-level decision | Official |
|---|---|---|---|
| TypedPair-NeoAraBERT | Two-head encoder | Majority + logit-sum | 88.33 |
| TypedPair-ARBERTv2 | Two-head encoder | Majority + logit-sum | 91.96 |
| TypedPair-AraBERTv02-Large | Two-head encoder | Top existence | 92.29 |
| TypedPair-AraModernBERT | Two-head encoder | Majority + logit-sum | 92.69 |
| Yehia-RE (row-local) | Row-local CE | Max positive | 92.84 |
| Yehia-RE (full-vocabulary) | Full-vocabulary CE | Max positive | 92.98 |
| Qwen-RE-4B | Causal-LM label generation | Nearest candidate | 91.53 |
| Qwen-RE-9B | Causal-LM label generation | Nearest candidate | 91.76 |
| Qwen-RE-9B-Cls | Sequence classification | Nearest candidate | 91.94 |
| Team ensemble | Yehia-RE (full-vocabulary) + Qwen-RE-9B-Cls + TypedPair-AraModernBERT | Majority vote; Yehia-RE tie-break | 94.06 |
Table 1: Summary of representative official KnowledgeGraphEval 2026 Subtask 2 submissions. Bold values mark the strongest configuration within each model family.
References
Chadi Abou Chakra, Hadi Khaled Hamoud, Osama Rakan Al Mraikhat, Qusai Abu Obaida, Mohamad Ballout, and Fadi Zaraket. 2026. NeoAraBERT: A modern foundation model for Arabic embeddings with diacritics-aware tokenization and POS-targeted masking. In Findings of the Association for Computational Linguistics: ACL 2026, pages 25952–25968, San Diego, California, United States. Association for Computational Linguistics.
Lakshya A Agrawal, Shangyin Tan, Dilara Soylu, Noah Ziems, Rishi Khare, Krista Opsahl-Ong, Arnav Singhvi, Herumb Shandilya, Michael J Ryan, Meng Jiang, Christopher Potts, Koushik Sen, Alex Dimakis, Ion Stoica, Dan Klein, Matei Zaharia, and Omar Khattab. 2026. GEPA: Reflective prompt evolution can outperform reinforcement learning. In The Fourteenth International Conference on Learning Representations.
Alaa Aljabari, Nagham Hamad, Abdellah El Mekki, Muhammad Abdul-Mageed, Imed Zitouni, Sanjay Chawla, and Mustafa Jarrar. 2026. KnowledgeGraphEval 2026: The First Shared Task on Arabic Knowledge Graphs. In Proceedings of the Fourth Arabic Natural Language Processing Conference, Budapest, Hungary. Association for Computational Linguistics.
Alaa Aljabari, Nagham Hamad, Mohammed Khalilia, and Mustafa Jarrar. 2025a. WojoodOntology: Ontology-driven LLM prompting for unified information extraction tasks. In Proceedings of The Third Arabic Natural Language Pro- cessing Conference, pages 179–193, Suzhou, China. Association for Computational Linguistics.
Alaa Aljabari, Mohammed Khalilia, and Mustafa Jarrar. 2025b. WojoodRelations: Arabic relation extraction corpus and modeling. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, pages 34342–34360, Suzhou, China. Association for Computational Linguistics.
Wissam Antoun, Fady Baly, and Hazem Hajj. 2020. AraBERT: Transformer-based model for Arabic language understanding. In Proceedings of the 4th Workshop on Open-Source Arabic Corpora and Processing Tools, with a Shared Task on Offensive Language Detection, pages 9–15, Marseille, France. European Language Resources Association.
Livio Baldini Soares, Nicholas FitzGerald, Jeffrey Ling, and Tom Kwiatkowski. 2019. Matching the blanks: Distributional similarity for relation learning. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pages 2895–2905, Florence, Italy. Association for Computational Linguistics.
Tim Dettmers, Artidoro Pagnoni, Ari Holtzman, and Luke Zettlemoyer. 2023. QLoRA: Efficient finetuning of quantized LLMs. In Advances in Neural Information Processing Systems, volume 36, pages 10088–10115.
AbdelRahim Elmadany, ElMoatez Billah Nagoudi, and Muhammad Abdul-Mageed. 2023. ORCA: A challenging benchmark for Arabic language understanding. In Findings of the Association for Computational Linguistics: ACL 2023, pages 9559–9586, Toronto, Canada. Association for Computational Linguistics.
Omar Elshehy, Omer Nacar, Abdelbasset Djamai, Muhammed Ragab, Khloud Al Jallad, and Mona Abdelazim. 2026. AraModernBERT: Transtokenized initialization and long-context encoder modeling for Arabic. In Proceedings of the 2nd Workshop on NLP for Languages Using Arabic Script, pages 313–321, Rabat, Morocco. Association for Computational Linguistics.
Nagham Hamad, Mohammed Khalilia, and Mustafa Jarrar. 2025. Konooz: Multi-domain multi-dialect corpus for named entity recognition. In Findings of the Association for Computational Linguistics: ACL 2025, pages 7316–7331, Vienna, Austria. Association for Computational Linguistics.
Mustafa Jarrar, Mohammed Khalilia, and Sana Ghanem. 2022. Wojood: Nested Arabic named entity corpus and recognition using BERT. In Proceedings of the Thirteenth Language Resources and Evaluation Conference, pages 3626–3636, Marseille, France. European Language Resources Association.
Damjan Kalajdzievski. 2023. A rank stabilization scaling factor for fine-tuning with LoRA. arXiv preprint arXiv:2312.03732.
Haneen Abdallatif Liqreina, Mustafa Jarrar, Mohammed Khalilia, Ahmed Oumar El-Shangiti, and Muhammad Abdul-Mageed. 2023. Arabic fine-grained entity recognition. In Proceedings of ArabicNLP 2023, pages 310–323, Singapore (Hybrid). Association for Computational Linguistics.
Navid-AI. 2025. Yehia 7b preview. https://huggingface.co/Navid-AI/Yehia-7B-preview.
Qwen Team. 2026. Qwen3.5: Towards native multimodal agents.
Osama Rakan Al Mraikhat, Hadi Hamoud, and Fadi A. Zaraket. 2024. AREEj: Arabic relation extraction with evidence. In Proceedings of the Second Arabic Natural Language Processing Conference, pages 67–72, Bangkok, Thailand. Association for Computational Linguistics.
Somin Wadhwa, Silvio Amir, and Byron Wallace. 2023. Revisiting relation extraction in the era of large language models. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 15566–15589, Toronto, Canada. Association for Computational Linguistics.
Zhen Wan, Fei Cheng, Zhuoyuan Mao, Qianying Liu, Haiyue Song, Jiwei Li, and Sadao Kurohashi. 2023. GPT-RE: In-context learning for relation extraction using large language models. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pages 3534–3547, Singapore. Association for Computational Linguistics.
Deming Ye, Yankai Lin, Peng Li, and Maosong Sun. 2022. Packed levitated marker for entity and relation extraction. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 4904–4917, Dublin, Ireland. Association for Computational Linguistics.
Kai Zhang, Bernal Jimenez Gutierrez, and Yu Su. 2023. Aligning instruction tasks unlocks large language models as zero-shot relation extractors. In Findings of the Association for Computational Linguistics: ACL 2023, pages 794–812, Toronto, Canada. Association for Computational Linguistics.
Wenxuan Zhou and Muhao Chen. 2022. An improved baseline for sentence-level relation extraction. In Proceedings of the 2nd Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 12th International Joint Conference on Natural Language Processing (Volume 2: Short Papers), pages 161–168, Online only. Association for Computational Linguistics.
A Data Processing and Artifacts
A.1 Source Resources and Processed Schema
The shared-task data are derived from Wojood , which extends Wojood with 40 directed relation types (Aljabari et al., 2025b). Wojood supplies nested entity annotations over 21 types (Jarrar et al., 2022), while WojoodOntology supplies relation definitions and directed domain–range constraints (Aljabari et al., 2025a).
We retained the original sentence, subject, object, and relation fields unchanged and added occurrence-specific character offsets, token offsets, and entity types. These additions support typed marker insertion, span validation, and ontology compatibility checks.
A.2 Verified Raw and Enriched Example
Table 2 shows a verified row from the original Wojood training file. The row illustrates the task input before our span and type enrichment.
The corresponding processed row retains all original fields and adds the resolved occurrence information shown in Table 3. This example is particularly useful because the object occurs inside the subject span, illustrating a nested mention case.
A.3 Artifacts and Processing Stages
The blind input contained no gold relation labels. It was used only to produce official predictions; we did not manually inspect, infer, or reconstruct its hidden labels.
A.4 Span and Entity-Type Recovery
Training relation rows provide entity surface forms but not the occurrence-specific spans and types required by our systems. We first align mentions with Wojood flat and nested NER annotations (Jarrar et al., 2022), preferring exact span matches and allowing compatible containment matches when necessary. Unresolved mentions are then matched against predictions from the Wojood NER model. After these automatic steps, two authors manually resolved the spans and entity types of the remaining 240 training rows, while retaining their original relation labels.
No manual span or type annotation is used for the blind set; its occurrences and entity types are determined entirely by the inference pipeline described in Appendix C.
A.5 Span Validation
For every processed row, we verified that the character slice identified by the subject offsets reproduced the subject string and that the object slice reproduced the object string. Rows with mismatched offsets were rejected rather than silently accepted. The final processed training and development artifacts reported zero slice errors.
This check is important because selecting the wrong repeated occurrence can associate a relation label with unrelated textual evidence. At blind inference, the systems resolve possible occurrence pairs as described in Appendix C.
A.6 Conflict Removal and Deduplication
We first removed groups containing contradictory annotations for the same resolved sentence and entity pair, reducing 17,381 raw rows to 17,208 non-conflicting rows. We then removed exact duplicates sharing the sentence, subject, object, and relation label. Together with the ontology-compatibility filtering described below, these preprocessing steps produced 15,686 final training instances.
A.7 Ontology Compatibility and Operational Mapping
For each positive training instance, we checked the resolved subject and object types against the directed domain–range constraints defined by WojoodOntology (Aljabari et al., 2025a). Because the task is directional, compatibility is evaluated specifically for the ordered pair . Training rows whose subject–object type pair was not a valid domain–range combination for the labeled relation were removed during preprocessing. This prevents the models from being trained on relation instances that are incompatible with the ontology under the resolved entity types.
We made one systematic modification to the operational compatibility map based on a highly frequent pattern observed in the labeled training data. In the original WojoodOntology constraints, the domain and range of Location.located_in are more restricted. However, the relation data repeatedly contain labeled Location.located_in examples involving ORG, FAC, LOC, and GPE entities in both subject and object positions. We therefore expanded the operational domain–range set for this relation to
This modification was motivated by the recurring annotation pattern in the provided relation data and was applied consistently during preprocessing and ontology-based candidate filtering. It is an implementation-level adaptation used by our system; it does not alter the published WojoodOntol-
| Field | Stored value |
|---|---|
| Sentence ID | 100002243 |
| Triple ID | 3830 |
| Sentence | • (1964 / 1 / 2) : قارارات جلسSCI: بارخ |
| Subject | باليةه قالية |
| Object | قالية |
| Relation | Location.located_in |
Table 2: Verified example from the original Wojood training artifact before our enrichment.
| Entity | Subject | Object |
|---|---|---|
| Surface form | باليةه قالية | قالية |
| Character span | (0, 13) | (6, 13) |
| Token span | (0, 1) | (1, 1) |
| Entity type | ORG | GPE |
Table 3: Occurrence-specific information added to the verified relation row in Table 2. Offsets are reproduced as stored in the processed artifact.
| Processing stage | Rows |
|---|---|
| Raw relation rows | 17,381 |
| After conflict removal | 17,208 |
| After ontology alignment and deduplication | 15,686 |
| Development artifact | 1,687 |
| Blind official input | 2,074 |
Table 4: Relation artifact sizes and preprocessing stages.
| Relation | Training rows |
|---|---|
| no_relation | 6,677 |
| Location.located_in | 4,269 |
| PartOf.geopolitical_division | 1,684 |
| Location.lives_in | 876 |
| Personal.has_occupation | 620 |
| Location.headquartered_in | 172 |
Table 5: Selected frequent and difficult relations in the processed training artifact.
ogy itself or the relation labels provided by the shared task.
A.8 Relation and Entity-Type Distributions
The subject side is dominated by organizations, persons, and geopolitical entities, while the object side is dominated by geopolitical entities, organizations, occupations, and locations. Frequent directed type pairs therefore include organization-place, place-place, organization-organization, person-place, and person-occupation.
B TypePredictor
B.1 Dataset Construction
The TypePrediction collection was curated from the Wojood and WojoodFine NER resources (Jarrar et al., 2022; Liqreina et al., 2023). Each example contains an Arabic sentence, one exact mention occurrence, and its entity type. TypePredictor is trained only on entity-type labels and never uses relation labels. Relation-extraction rows were excluded from this curation. Exact duplicate mentions were collapsed, and same-span examples with conflicting labels were removed.
The resulting collection contains 125,996 examples over 21 types: 100,796 for training, 12,600 for validation, and 12,600 for testing. The split is a shuffled, stratified, mention-level 80/10/10 split. It was produced using two stratified train_test_split operations with random_state=42. The same sentence may occur in multiple splits with different entity spans. Because the split is mention-level, sentence-level overlap with relation-extraction inputs, including the blind evaluation input, is possible. Such overlap may affect the entity-type predictions subsequently used for typed markers and ontology filtering, but it does not expose relation labels to TypePredictor. Validation and test examples are therefore additionally categorized as seen_sentence_new_entity or unseen_sentence.
| GPE26,902 | ORG26,593 | DATE19,762 | PERS10,712 | NORP10,217 | ORDINAL7,807 | OCC7,696 | EVENT3,769 |
|---|---|---|---|---|---|---|---|
| CARDINAL3,724 | LOC2,388 | WEBSITE1,478 | FAC1,296 | LAW904 | TIME871 | MONEY420 | CURR411 |
| LANGUAGE332 | PERCENT312 | PRODUCT190 | QUANTITY106 | UNIT106 |
Table 6: TypePrediction mention counts over all splits.
B.2 Verified Example
Table 7 gives a verified TypePrediction training row. Unlike the relation artifacts, the TypePrediction files do not physically store the marked model input. The marked input is constructed at loading time from the sentence and stored character offsets.
Training rows store entity, type, sentence, start_token, end_token, start_char, end_char, raw_types, sources, and id; validation and test rows additionally store evaluation_category. The marked input itself is not stored.
For the example in Table 7, the generated input contains the fragment
The model input is generated as
possibly within a selected context window. The tokens [ENT] and [/ENT] were explicitly added to the tokenizer as special tokens with IDs 65,000 and 65,001, respectively, and the encoder embedding matrix was resized to a vocabulary size of 65,002.
B.3 Architecture and Training
The TypePredictor consists of U4RASD/NeoAraBERT and a single classification layer. Let be the final hidden states and let . The classifier computes
The 768 → 21 head contains 16,149 parameters. Training minimizes unweighted multiclass cross-entropy and inference returns the highest-scoring type.
B.4 Detailed Evaluation
We further evaluate the TypePredictor using aggregate performance metrics, sentence-level generalization categories, per-type performance, and diagnostic visualizations. Overall validation and test performance is reported in Table 9, while Table 10 separates performance between seen sentences with new entity spans and entirely unseen sentences. Table 11 provides the detailed per-type precision, recall, and scores on the test split. Finally, Figure 2 presents the normalized confusion matrix, per-class scores, and performance across sentence categories.
C Shared Inference Pipeline
C.1 Marker Insertion and Overlap Handling
Markers are inserted from character spans rather than through global surface replacement. Insertions are ordered to keep nested, overlapping, adjacent, and equal-span cases deterministic. After tokenization, the system verifies that the required opening and closing marker IDs remain present. When necessary, the sentence is cropped around the outer entity boundaries.
C.2 Ontology Filtering
For a predicted directed type pair , the operational WojooodOntology map returns the compatible positive relations. no_relation remains available for every pair. Incompatible encoder and classifier logits are masked, while generative prompts display or score only compatible labels.
C.3 Candidate-Pair Handling
The model families use different strategies when several occurrence pairs are possible; there is no single nearest-distance rule shared by all released runners. TypedPair can score all candidate pairs and aggregate their predictions as described in Appendix D. Yehia-RE also scores candidate pairs and applies the row-level aggregation rules described in Appendix E.
| Field | Stored value | |
|---|---|---|
| ID (id) | tp_093924 | |
| Entity (entity) | النظام | |
| Type (type) | ORG | |
| Sentence (sentence) | كأ تير النظمة مركأا للإصابات البalعة في ملىرىة霍班ان، وهويعاج جري الحرب والمرضي النين، ختاجون إلى ROاعية الطية، | |
| Token span (start_token, end_token) | (2, 2) | |
| Character span (start_char, end_char) | (9, 16) | |
| Raw types (raw_types) | ORG, NONGOV | |
| Sources (sources) | Wojood1_1_flat/test; WojoodFine-Flat/split20 | Wojood1_1_nested/test; |
Table 7: Verified TypePrediction training example.

(a) Row-normalized confusion matrix.
(b) Per-class test .
(c) Macro- by sentence category.
Figure 2: TypePredictor diagnostic plots on the held-out test split.
| Setting | Value |
|---|---|
| Encoder | U4RASD/NeoAraBERT |
| Classes / maximum length | 21 / 512 |
| Epochs | 4 |
| Train/eval batch | 4 / 8 |
| Gradient accumulation | 4 |
| Encoder/head LR | |
| Optimizer | AdamW (adamw_torch) |
| Scheduler | Linear |
| Weight decay / warm-up | 0.01 / 0.10 |
| Maximum gradient norm | 1.0 |
| Precision / seed | FP16 / 42 |
| Loss | Unweighted cross-entropy |
| Selection metric | Validation macro- |
Table 8: TypePredictor training configuration.
For Qwen-RE configurations using the nearest-candidate heuristic, let the subject span be and the object span be . Candidate pairs are sorted lexicographically by
- character gap
- twice the absolute distance between span centers,
-
ascending subject start offset ; and
-
ascending object start offset .
The first candidate under this ordering is selected. Overlapping and nested mentions therefore receive a character gap of zero, and the final two offsets make ties deterministic.
D TypedPair Encoder Systems
D.1 Typed Directional Input
For subject and object types and , the sentence receives typed opening and closing markers such as [SUBJ_PERS] and [OBJ_ORG]. Across 21 entity types, this introduces 84 marker strings. We additionally construct the directional type vector
where the first 21 coordinates always represent the subject and the final 21 represent the object.
D.2 Pair Representation and Two-Head Objective
Let be the encoder output, and let , and denote the sequence-start, subject-opening, and object-opening states. The directed
| Split | Rows | Accuracy | Micro- | Macro- | Weighted- | Top-3 | Top-5 |
|---|---|---|---|---|---|---|---|
| Validation | 12,600 | 97.79 | 97.79 | 95.87 | 97.78 | 99.36 | 99.64 |
| Test | 12,600 | 97.94 | 97.94 | 95.99 | 97.93 | 99.35 | 99.62 |
Table 9: TypePredictor performance. Scores are percentages.
| Split | Category | Rows | Accuracy | Macro- | Weighted- | Top-5 |
|---|---|---|---|---|---|---|
| Validation | Seen sentence/new span | 11,661 | 98.04 | 96.33 | 98.04 | 99.70 |
| Validation | Unseen sentence | 939 | 94.57 | 86.56 | 94.50 | 98.94 |
| Test | Seen sentence/new span | 11,606 | 98.08 | 96.41 | 98.07 | 99.67 |
| Test | Unseen sentence | 994 | 96.28 | 85.06 | 96.18 | 98.99 |
Table 10: TypePredictor results by sentence category.
| Type | Support | P | R | |
|---|---|---|---|---|
| GPE | 2,691 | 97.39 | 98.44 | 97.91 |
| ORG | 2,659 | 98.08 | 97.82 | 97.95 |
| DATE | 1,977 | 99.04 | 99.54 | 99.29 |
| PERS | 1,071 | 97.95 | 98.32 | 98.14 |
| NORP | 1,021 | 97.65 | 97.85 | 97.75 |
| ORDINAL | 781 | 98.21 | 98.34 | 98.27 |
| OCC | 770 | 98.70 | 98.96 | 98.83 |
| EVENT | 377 | 98.64 | 96.29 | 97.45 |
| CARDINAL | 372 | 97.79 | 95.16 | 96.46 |
| LOC | 239 | 96.96 | 93.31 | 95.10 |
| WEBSITE | 148 | 96.69 | 98.65 | 97.66 |
| FAC | 129 | 92.80 | 89.92 | 91.34 |
| LAW | 91 | 100.00 | 100.00 | 100.00 |
| TIME | 87 | 91.57 | 87.36 | 89.41 |
| MONEY | 42 | 97.37 | 88.10 | 92.50 |
| CURR | 41 | 97.56 | 97.56 | 97.56 |
| LANGUAGE | 33 | 87.50 | 84.85 | 86.15 |
| PERCENT | 31 | 96.43 | 87.10 | 91.53 |
| PRODUCT | 19 | 100.00 | 94.74 | 97.30 |
| QUANTITY | 10 | 90.91 | 100.00 | 95.24 |
| UNIT | 11 | 100.00 | 100.00 | 100.00 |
Table 11: Per-type TypePredictor results on the 12,600-row test split.
pair representation is
Its dimensionality is . A shared MLP applies using LayerNorm, GELU, and dropout.
The existence head returns , while the positive-relation head returns . For relation label , define . Training minimizes
Thus, every row supervises relation existence, whereas negative rows do not assign an arbitrary target to the positive-relation head.
D.3 Row-Level Candidate Strategies
For occurrence-pair candidate , let
after ontology-incompatible positive relations have been masked. The released pipeline contains several deterministic alternatives for combining predictions across occurrence pairs.
Majority + logit-sum. Let among candidates. The row is treated as positive only when
For a positive row, masked positive-relation logits are summed over the passing candidates and the relation with the largest aggregate score is selected.
Top existence. First select
If , the row is assigned no_relation. Otherwise, the output is
Max joint. Among candidates that pass the existence threshold, select
If no candidate passes the threshold, the result is no_relation.
Soft joint pooling. Positive evidence for relation is pooled as
and the relation with the largest pooled score is returned when a positive decision is made. Ties are resolved deterministically using decision score, existence probability, candidate order, and relation index.
| Operation | Base | Large |
|---|---|---|
| Encoder states | ||
| Pair vector | 3,882 | 5,162 |
| Shared hidden | 512 | 512 |
| Existence logits | 2 | 2 |
| Positive logits | 40 | 40 |
Table 12: TypedPair tensor dimensions.
| Configuration | Official |
|---|---|
| NeoAraBERT, interactions, majority + logit-sum | 88.33 |
| NeoAraBERT, top existence | 88.59 |
| AraBERTv02 | 89.33 |
| NeoAraBERT, no interactions | 89.36 |
| ARBERTv2 | 91.96 |
| AraBERTv02-Large, soft pool | 92.20 |
| AraBERTv02-Large, top existence | 92.29 |
| AraModernBERT | 92.69 |
Table 13: Official TypedPair results.
D.4 Dimensions and Training
For , the MLP and heads add 4,525,610 parameters; for , they add 5,836,330. The no-interactions variant uses and adds 2,952,746 parameters.
Training uses four epochs, maximum length 512, physical batch size 4, gradient accumulation 4, encoder learning rate , new-layer learning rate , weight decay 0.01, warm-up, FP16, and MLP dropout 0.1. Evaluation occurs every 250 optimizer steps. For the released AraModernBERT model, the existence threshold selected on labeled validation data is 0.01, with positive micro- used for threshold selection.
D.5 Extended Official Results
Table 13 summarizes the official scores across encoder configurations, with AraModernBERT obtaining the highest reported score of 92.69.
D.6 AraModernBERT Component Ablation
AraModernBERT achieved the strongest encoder result and was therefore used to compare configurations with and without typed text markers and the directional type vector. Table 14 reports the corresponding official full-pipeline ablation submissions.
The complete configuration obtains the strongest result among these four submissions. The ablation artifacts share the intended four-epoch training setup, batch sizes, learning rates, weight decay, warm-up, MLP dimensions, dropout, and TypePredictor dependency.
| Typed markers | Type vector | Official |
|---|---|---|
| No | No | 90.65 |
| No | Yes | 90.75 |
| Yes | No | 89.94 |
| Yes | Yes | 92.69 |
Table 14: AraModernBERT component ablation on the blind evaluation.
E Yehia-RE
E.1 Row-Specific Arabic Multiple Choice
Early Yehia variants generated full Arabic relation phrases and were vulnerable to explanatory text, punctuation, and harmless lexical variation. Yehia-RE instead reformulates each instance as a row-specific Arabic multiple-choice problem.
For each ontology-compatible relation, the option shown to the model is an Arabic natural-language template (template_ar), rather than the canonical relation identifier. Our Arabic relation templates were inspired by the relation-aware templates used in the Wojood /SinaTools implementation (Aljabari et al., 2025b). Thus, labels such as Affiliation.employee_of are used internally to construct and evaluate the example, while the model sees the corresponding Arabic formulation, such as الأول يعمل لدى الكاني. The canonical relation names are not presented as answer options.
Each displayed Arabic option is assigned a verified one-token Arabic code. The available codes are،،،،،،. The codes are row-local addresses rather than global relation-class IDs, and no_relation is represented by its own Arabic option. The largest ontology-compatible candidate set contains nine positive relations, for the directed type pair PERS→ORG. Including no_relation, a row therefore contains at most ten options, matching the ten available Arabic answer codes.
E.2 Full-Vocabulary and Row-Local Objectives
In both variants, all prompt and padding tokens are masked from the training loss so that exactly one assistant code token is supervised.
For the full-vocabulary variant, let be the gold code and the complete model vocabulary. The
https://github.com/SinaLab/sinatools objective is
At inference, only the codes corresponding to options displayed in the current row are compared.
The row-local variant instead normalizes directly over the displayed code set :
E.3 Prompt Template
The Yehia-RE system message is:
أنت مصنف علاقات. حدد العلاقة الموجهة من
الكان [الأول] إلى الكان [الثاني].
ahتر علاقة ووحدة من القامة تاسب معن ABل
ونوحي الكانين.
إن لم تتطرق أي علاقة فختر (لا توجد علاقة).
أجب بمن الأغيار ققط: حرف عريي ووحد دون
رقم أو شح.
The row-specific user message follows this structure:
{marked_sentence}
{first_type_ar} : نوع الأول :
{second_type_ar} : نوع الثاني :
الغيارات:
{1 {option (أ
{2 {option (ب
...
لا توجد علاقة
رمن الإجابة:
The assistant message contains exactly one displayed code.
E.4 Complete Training Example
The following is a fully instantiated training example from the released record train_1831. The canonical relation identifiers are used only internally to construct and evaluate the example; the actual prompt presents the corresponding Arabic template_ar options.
System message.
أنت مصنف علاقات. حدد العلاقة الموجهة من
الكان [الأول] إلى الكان [الثاني].
ahتر علاقة ووحدة من القامة تاسب معن ABل
ونوحي الكانين.
إن لم تتطرق أي علاقة فختر (لا توجد علاقة).
أجب بمن الأغيار ققط: حرف عريي ووحد دون
رقم أو شح.
User message.
الجابة:
خَدد ندهاتا للسلطات التركية العنية لسيل
الoireر العاجل للإمادات الأسasive والموظفين
إلى شمل غرب سوريا للسماح بوسيع نطاق
استجابتنا الإناسية والطية في المنطقة. "الأول"
كريستيان ريدزز [الأول]، منسق أatchedة
الثاني [أطباء بلahدود] في الثاني في شمل غرب
سوريا.
نوع الأول: شص
نوع الثاني: منظمة
الغيارات:
أ) الأول قاعد الثاني
ب) الأول مؤسس الثاني
ج) الأول رئيس الثاني
د) الأول مدير الثاني
ه) الأول عضو في الثاني
و) الأول值班 لدى الثاني
ز) الأول يعمل لدى الثاني
ح) الأول منافس الثاني
ط) الأول مالك الثاني
ي) لا توجد علاقة
رمن الإجابة:
Assistant target.
ز
The target code maps internally to Affiliation.employee_of. The canonical relation identifier is not shown to the model as an answer option; instead, the model sees its Arabic template_ar, الو_يعمل لدى الثاني. Only the single assistant code token contributes to the training loss.
E.5 Deterministic Transformation
For each training row, the builder validates spans and types, inserts [الأول] and [ال最后是] with overlap-safe ordering, maps types to Arabic names, retrieves compatible relations, renders their Arabic template_ar formulations, deterministically shuffles positive options with seed 42, appends no_relation, assigns one-token codes, maps the gold relation to its code, and builds the chat messages.
The corresponding audit checks marker occurrence, option uniqueness, domain/range compatibility, code-token alignment, reversibility, maximum sequence length, and absence of canonical relation-identifier leakage from the answer.
E.6 QLoRA Configuration
Yehia-RE uses rank-stabilized LoRA (RS-LoRA) (Kalajdzievski, 2023). The all-linear audit finds 225 supported linear/head modules: seven internal projections in each of 32 transformer layers plus the language-model head. PEFT wraps the 224 internal modules and leaves 1m_head frozen. Only the 448 LoRA matrices receive gradients.
E.7 One-Token Masking Audit
For each labeled row, the system message, user message, chat-template boundary, trailing template tokens, and padding positions receive label -100. Exactly one assistant code token contributes to the loss. A row is rejected if the prompt/full-conversation boundary differs, the answer code is not one token, or the sequence exceeds 1,024 tokens.
E.8 Candidate-Pair Aggregation
For occurrence-pair candidate , let denote the normalized probability of displayed option code . Let be the winning code, its relation, and define
as the candidate confidence. We also define the score margin
where and are the largest and second-largest option log-probabilities.
The released runner implements the following row-level strategies.
Top confidence. Select from all occurrence-pair candidates according to the lexicographic key
where c is the deterministic candidate index. The winning candidate's relation, including no_relation when applicable, is returned.
Max positive. Discard candidates whose predicted relation is no_relation. If no positive candidate remains, return no_relation. Otherwise, select the remaining candidate using the same lexicographic ordering
and return its predicted positive relation.
Majority vote. Let N be the total number of candidate occurrence pairs and let . Positive voting is allowed only when at least
candidates predict a positive relation; otherwise the row is assigned no_relation. Positive candidates vote by predicted relation. A relation-count tie is broken by, in order:
-
the sum of normalized probability support for the tied relation over all candidates;
-
the largest winning-candidate margin for that relation; and
-
canonical relation order.
E.9 vLLM Inference
The released blind-test runner uses BF16 bitsandbytes loading, one GPU, tensor_parallel_size=1, maximum length 1,024, prefix caching, temperature 0, top-p = 1, one generated token, and an allowed-token list equal to the codes displayed in the current row. Requests are batched up to 512 prompts.
E.10 Representative Official Results
Table 16 summarizes the official results of the two Yehia-RE training variants.
| Category | Setting | Value | Notes |
|---|---|---|---|
| Base | Model | Navid-AI/Yehia-7B-preview | pinned revision |
| Base | Revision | b9dda4715eafee7e8090d2c83cfe078d75f4ebb8 | |
| Runtime | Quantization | 4-bit NF4 + double quant. | BF16 compute |
| Runtime | Maximum length | 1,024 | gradient checkpointing |
| LoRA | Target | eligible internal linear layers | RS-LoRA |
| LoRA | r/α/dropout | 16 / 32 / 0.05 | 39,976,960 trainable |
| Training | Batch/accumulation | 4 / 4 | effective batch 16 |
| Training | Epochs/steps | 3 / 2,943 | best step 2,750 |
| Training | LR / warm-up | cosine, zero decay | |
| Training | Optimizer | paged_adamw_8bit | clipping 1.0 |
| Sampling | Row weight | replacement | |
| Evaluation | Frequency | 250 steps | full development set |
| Seed | Data and model | 42 | one reported seed |
Table 15: Selected Yehia-RE QLoRA configuration.
| Variant | Row decision | Official |
|---|---|---|
| Full-vocabulary | Max positive | 92.98 |
| Row-local | Max positive | 92.84 |
Table 16: Representative official Yehia-RE results.
F Qwen-RE
F.1 Causal-LM Prompt Template
The Qwen-RE causal-LM prompt is constructed separately for each directed subject–object pair. It contains a system message defining the relation extraction task and required output format, followed by a user message containing the marked Arabic sentence, the subject and object strings and their predicted entity types, and only the relations compatible with the directed type pair under the operational ontology. Each compatible relation is presented with its label, Arabic template, direction note, and concise meaning. The generic prompt structure is shown below, where braced expressions denote row-specific values.
System message
You are an Arabic relation extraction system.
Given one Arabic sentence with a marked subject and object, return exactly one relation label.
You must always choose one label from the allowed label set.
Use the Arabic relation templates and direction notes as ontology definitions.
Prefer a positive relation label whenever the sentence provides plausible evidence for one.
Use no_relation only as a last resort when none of the allowed positive relations is supported.
Do not copy explanations, templates, or direction notes.
Return only the exact label text and nothing else.
User message
Classify the relation from the marked SUBJECT to the marked OBJECT.
The sentence uses [SUBJ/...] [/SUBJ/...] and [OBJ/...] [/OBJ/...] markers.
Use the Arabic ontology template beside each allowed label to understand its meaning.
Follow each direction note strictly because relation direction changes the label.
Choose exactly one label from the provided label set.
Prefer choosing the best-supported positive relation.
Use no_relation only when none of the allowed positive relations fits the marked sentence.
Task rules
-
Read the Arabic sentence and identify the relation between the marked subject and object.
-
Choose exactly one relation label.
-
Prefer the best-supported positive relation instead of defaulting to no_relation.
-
Use no_relation only when none of the allowed positive relations fits the marked sentence.
-
Use the Arabic templates and direction notes as label definitions, not as text to copy.
-
Return only the label text with no explanation.
Allowed labels and ontology meanings for this subject–object type pair
Direction: classify the relation from SUBJECT to OBJECT.
{RelationLabel}: Arabic template: SUBJECT OBJECT template {relation
Direction: {relation-specific direction note}
Meaning: {concise relation meaning}
The preceding relation block is repeated for every ontology-compatible positive relation.
no_relation: Arabic template: لا توجد علاقة صريحة في هذه الأثمة ين
Direction: use only when no allowed positive relation is supported by the marked sentence.
Meaning: no allowed positive relation is supported between the marked SUBJECT and OBJECT in the required direction.
Subject: {subject}
Object: {object}
Subject type: {subject type}
Object type: {object type}
Sentence:
and SUBJECT typed the containing {sentence markers} OBJECT
Answer:
During supervised fine-tuning, the assistant response following this prompt contains only the gold relation label. At inference, no gold label is provided: the constructed prompt ends at Answer:, after which the causal language model predicts the relation label. Because the candidate inventory is derived from the predicted directed entity-type pair, the allowed label set can differ from one input row to another.
F.2 Verified Causal-LM Training Example
The following example instantiates the prompt in Appendix F.1 using the verified training row triple_id=3830 from Table 2.
Subject: بالدية ق李宁ية
Object: ق李宁ية
Subject type: ORG
Object type: GPE
Allowed relations:
Business.has_conflict_with: SUBJECT
OBJECT ت注:
Location.headquartered_in: SUBJECT
OBJECT مقère الميسي في
Location.located_in: SUBJECT
OBJECT
Location.nearby: يمع بالقرب من SUBJECT
OBJECT
no_relation: و SUBJECT و
لا توجد علاقة صالحة بين OBJECT
في هذه الاجابة
Sentence:
ق李宁ية [OBJ/GPE] بالدية [SUBJ/ORG]
/ : [SUBJ/ORG] [OBJ/GPE]
مدير منظمة ق李宁ية : قارات جسSCI على ق李宁ية : بارخ
. (1964 / 1 / 2
Assistant target: Location.located_in
During inference, the same row-specific prompt content is used without the assistant target, and the model predicts one of the allowed labels.
F.3 Generation and Complete-Label Scoring
Free-form generation can produce explanations, punctuation, partial labels, or an incompatible continuation. We therefore evaluate complete-label scoring. Let denote the ontology-compatible candidate set, including no_relation. For candidate label , its score is the mean token log-probability
The selected label is
For analysis, scores can be normalized over the compatible set:
This normalization does not change the highest-scoring label, although its value depends on the size and composition of the candidate set.
F.4 Sequence-Classifier Prompt and Objective
Qwen-RE-9B-Cls receives the same marked sentence and entity metadata but uses a shorter instruction because the model learns a fixed 41-way classification head.
A rendering for the same verified example is:
You are an expert Arabic relation extraction encoder.
Determine the semantic relation from the marked SUBJECT to the marked OBJECT. Respect relation direction and use no_relation only when no positive relation is stated or clearly implied. The classification head selects the final class; do not generate an answer.
Arabic sentence:
[OBJ/GPE] بالدية [SUBJ/ORG]
/ : [SUBJ/ORG] [OBJ/GPE]
مدير منظمة ق李宁ية : قارات جسSCI على ق李宁ية : بارخ
. (1964 / 1 / 2
SUBJECT: ق李宁ية
SUBJECT type: ORG
OBJECT: ق李宁ية
OBJECT type: GPE
| Property | Causal LM | Classifier |
|---|---|---|
| Output | Generated/scored label | One score per class |
| Objective | Token prediction | Multiclass CE |
| Inference | Generation/scoring | Masked argmax |
| Parsing | Required | Not required |
| Ontology | Prompt/candidate set | Direct logit mask |
Table 17: Qwen-RE causal-LM and classifier formulations.
For input , let be the compatible relation classes, including no_relation. The classifier produces . Ontology-incompatible logits are masked before cross-entropy, so the effective training objective is
Rows whose gold relation is incompatible with the supplied entity types are rejected, and the same compatibility mask is used for evaluation and final prediction.
F.5 Class-Imbalance Interventions
For weighted causal-LM training, raw inverse-frequency weights are
They are normalized to mean one and clipped:
Qwen-RE-9B-Cls instead uses a weighted random sampler with
F.6 QLoRA Fine-Tuning
Qwen3.5-4B and Qwen3.5-9B are adapted with QLoRA (Dettmers et al., 2023). The frozen backbone is loaded in 4-bit NF4 with double quantization and BF16 computation. LoRA adapters target q_proj, k_proj, v_proj, o_proj, gate_proj, up_proj, and down_proj.
The sequence-classification run uses train/evaluation batch sizes 4/4, gradient accumulation 4, and maximum sequence length 1,280; the recorded causal-LM evaluation configuration uses batch size 1. The classifier's recorded LoRA rank and scaling are and .
| Hyperparameter | Value |
|---|---|
| Training epochs | 8 |
| Learning rate | |
| Scheduler / warm-up | Cosine / 0.03 |
| Weight decay | 0.0 |
| LoRA /dropout | 32 / 64 / 0.05 |
| Quantization | 4-bit NF4 |
| Double quantization | Yes |
| Compute dtype | bfloat16 |
| Optimizer | Paged AdamW 8-bit |
| Gradient checkpointing | Yes |
| Evaluation interval | 1,000 steps |
| Seed | 42 |
Table 18: Core Qwen-RE QLoRA settings recorded by the released configurations.
| Checkpoint | Positive | Acc./micro- |
|---|---|---|
| Base prompt | 0.5641 | 0.4707 |
| Step 1,000 | 0.5035 | 0.6129 |
| Step 2,000 | 0.7155 | 0.6977 |
| Step 2,943 | 0.7099 | 0.6941 |
Table 19: Archived Qwen-RE-9B development results.
F.7 Validation and Checkpoint Selection
Causal-LM checkpoints are evaluated on the 1,687 development examples using generation-based inference. Outputs are mapped to the relation inventory, with ontology-incompatible predictions mapped to no_relation, and checkpoints are selected by development micro-.
The best confirmed development micro- is 0.6846 for Qwen-RE-4B and 0.6977 for Qwen-RE-9B. Table 19 shows the archived trajectory for the inspected 9B run. Since this is single-label classification, accuracy equals all-class micro-; positive-only is reported separately.
Step 2,000 correctly predicts 1,177 of 1,687 examples. Because the archive does not reliably map checkpoint steps to epochs, we report steps directly. These development results are not directly comparable with the official blind scores because they use a different split and evaluation pipeline.
F.8 Extended Results
The official scores differ by 0.18 points between Qwen-RE-9B and Qwen-RE-9B-Cls.
G Qwen Exploratory Prompt Optimization
G.1 Disambiguation Rules
We manually wrote decision rules for semantically close relations using the definitions in WojoodOn-
| Qwen-RE system | Official |
|---|---|
| Qwen-RE-4B | 91.53 |
| Qwen-RE-9B | 91.76 |
| Qwen-RE-9B-Cls | 91.94 |
Table 20: Official Qwen-RE results.
tology (Aljabari et al., 2025a). A representative fragment is:
Allowed labels and Arabic meanings:
Location.located_in: ordinary physical or geographic containment.
Location.headquartered_in: OBJECT is the headquarters or principal institutional location of SUBJECT.
PartOf.geopolitical_division: SUBJECT is an administrative or geographic division of OBJECT.
Decision rule: Prefer the more specific headquarters, administrative-division, capital, border, or proximity relation when its evidence is present; otherwise use ordinary containment.
These rules were diagnostically useful but did not eliminate confusion. In particular, headquarters examples could still be predicted as Location.located_in, while longer supportive and contrastive rules reduced validation performance for the selected Qwen configuration.
G.2 GEPA Prompt Evolution
We explored GEPA, a reflective prompt-evolution method that revises prompts using model errors and validation performance (Agrawal et al., 2026). The experiment used a stratified subset of 506 training examples and 196 validation examples.
For each candidate prompt, prediction errors were summarized with the gold and predicted labels, model output, compatible labels, relation meanings, and disambiguation guidance. The reflective editor openai/gpt-5.5 used this feedback to propose revised prompts, which were evaluated on the validation subset and selected using GEPA's Pareto-based procedure.
The best stored GEPA prompt obtained positive and accuracy 0.5408 on the 196-example validation subset. Because the corresponding pre-GEPA score on the same subset was not recorded, we do not claim a measured improvement over the initial prompt. This experiment was exploratory and did not replace the official system.
H Additional Error Analysis
H.1 Entity-Type Errors
A hard type error can simultaneously alter the typed text markers, the 42-dimensional subject-object type vector, and the ontology-compatible relation inventory. Type prediction is therefore consequential even though TypePredictor achieves high aggregate accuracy, particularly for lower-support types and unseen-sentence mentions.
H.2 Repeated Mentions
When a surface form occurs multiple times, the system must associate the provided subject and object strings with the textual occurrences that express the relation. Nearest-candidate selection can choose an incorrect occurrence, while score-all inference increases computation and introduces competing span hypotheses. Joint occurrence and relation scoring is a natural direction for future work.
H.3 Semantically Close Relations
A recurring difficulty is distinguishing generic and specific geographic relations, particularly Location.located_in, Location.headquartered_in, and PartOf.geopolitical_division.
The much larger training support for Location.located_in can favor the generic relation when the sentence contains evidence for a more specific alternative.
H.4 Causal Generation Errors
Causal generation adds a separate failure mode: a model can assign useful semantic probability mass to the correct relation while still generating extra prose, punctuation, an alias, or only part of a canonical label. This motivated complete-label scoring in Qwen-RE and the direct 41-way classification formulation in Qwen-RE-9B-Cls.
I Reproducibility
I.1 Released Resources
The current public inventory includes:
• U4RASD/TypePredictor;
• U4RASD/DRU-RE-TypedPair-TwoHead;
- TypedPair checkpoints for AraModernBERT, AraBERTv02, ARBERTv2, AraBERTv02-Large, and NeoAraBERT-no-interactions;
• U4RASD/DRU-RE-Yehia and U4RASD/DRU-RE-Yehia-2;
• U4RASD/WojoodRelationsAnnotated;
• U4RASD/Yehia-RE-SFT;
• U4RASD/TypePrediction; and
• U4RASD/DRU-RE-Qwen.
The repository identifiers retain their released names even where the paper uses the consolidated display names Yehia-RE and Qwen-RE.
I. 2 Training and Selection Summary
I. 3 Software, Hardware, and Model Revisions
The released artifacts do not contain one environment manifest shared by all experiments. Table 22 therefore reports exact recorded values where available and explicitly marks information that was not preserved rather than estimating it.
TRL is not listed as a dependency of the recorded Yehia-RE training environment. Exact Python and CUDA toolkit versions for Yehia-RE, and the corresponding complete software/hardware environment for Qwen-RE, are not recoverable from the archived releases and are therefore not inferred here.
| Component | Backbone | Training | Output | Selection rule |
|---|---|---|---|---|
| TypePredictor | NeoAraBERT | Full fine-tuning, 4 epochs | 21 type logits | Validation macro- |
| TypedPair | Arabic encoders | Full fine-tuning, 4 epochs | Existence + 40 relation logits | Development positive micro- |
| Yehia-RE | Yehia-7B | QLoRA, 3 epochs | One Arabic code token | Development positive micro- |
| Qwen-RE-4B/9B | Qwen3.5-4B/9B | QLoRA, 8 epochs | Canonical label text | Development micro- |
| Qwen-RE-9B-Cls | Qwen3.5-9B | QLoRA + 41-way head | Masked class logits | Development micro- |
Table 21: Cross-system summary of the principal training and selection choices. Detailed configurations are reported in the corresponding system appendices.
| System | Component | Recorded value | Notes |
|---|---|---|---|
| TypePredictor | Python | 3.12.3 | Recorded environment |
| TypePredictor | PyTorch | 2.5.1+cu124 | Recorded environment |
| TypePredictor | Transformers | 4.49.0 | Recorded environment |
| TypePredictor | GPU | NVIDIA A40 | 44.43 GiB reported |
| Yehia-RE | PyTorch | 2.5.1 | Training requirements |
| Yehia-RE | Transformers | 4.57.1 | Training requirements |
| Yehia-RE | PEFT | 0.17.1 | Training requirements |
| Yehia-RE | bitsandbytes | 0.45.5 | Training requirements |
| Yehia-RE | vLLM | 0.10.2 | Blind-test runner |
| Yehia-RE | GPU | NVIDIA L40S | Selected run validated on one GPU |
| Yehia-RE | Base revision | b9dda471...f4ebb8 | Full hash reported in Appendix E |
| Qwen-RE | PyTorch | 2.5.1 | Training environment |
| Qwen-RE | Transformers | 4.49.0 | Training environment |
| Qwen-RE | PEFT | 0.19.1 | Recorded adapter configuration; LoRA/QLoRA adapter implementation |
| Qwen-RE | bitsandbytes | 0.50.0 | 4-bit QLoRA quantization; latest PyPI release before 31 July 2026 |
| Qwen-RE | GPU | NVIDIA RTX PRO 4500 | Training hardware |
Table 22: Software, hardware, and revision information recoverable from the released experiment artifacts.