Skip to content

Sintesi di Software tramite Rappresentazioni Intermedie Ipergrafiche in Formato NDJSON-LD: Formalizzazione di un Framework di Generazione Vincolata per Modelli Linguistici Autoregressivi

Aug 2026 · Zenodo (CERN European Organization for Nuclear Research)
Software Engineering Research

Abstract

Sintesi di Software tramite Rappresentazioni Intermedie Ipergrafiche in Formato NDJSON-LD: Formalizzazione di un Framework di Generazione Vincolata per Modelli Linguistici Autoregressivi Autore: Luigi Usai Affiliazione / Località: Quartucciu (CA), Italia Data: 29 Agosto 2026 ORCID: https://orcid.org/0009-0003-3001-717X Identificatore di Categoria (Zenodo/ACM): Computer Science – Software Engineering (cs.SE); Artificial Intelligence (cs.AI); Formal Languages (cs.FL). Abstract La generazione di software strutturato e monolitico tramite modelli linguistici di grandi dimensioni (LLM) presenta storicamente tassi elevati di allucinazione dell'interfaccia, violazioni di invarianti logici e divergenza sintattica nei contesti zero-shot non vincolati. Questo lavoro formalizza una metodologia di sintesi single-prompt a due stadi basata sull'induzione preventiva di un ipergrafo matematico $H=(V,E)$ serializzato nello standard NDJSON-LD (Newline Delimited JSON for Linked Data). Attraverso la scomposizione delle dipendenze $n$-arie tra tipi, funzioni, invarianti e canali di I/O prima dell'emissione del codice target (Python), il modello riduce drasticamente l'entropia condizionale nello spazio di decodifica autoregressiva. Il formalismo proposto converte il task da un problema di generazione a sintassi libera a una proiezione isomorfa guidata da uno schema topologico. Vengono presentati il framework matematico, la specifica della grammatica NDJSON-LD, l'architettura della pipeline di inferenza e il protocollo sperimentale di falsificazione empirica. Parole chiave: Program Synthesis, Neurosymbolic AI, Hypergraph Theory, NDJSON-LD, Prompt Engineering, Large Language Models, AST Generation, Code Reliability. 1. Introduzione e Definizione del Problema Nei modelli autoregressivi basati sull'architettura Transformer, la probabilità di emissione di una sequenza di codice sorgente $C = (c_1, c_2, \dots, c_T)$ a partire da una specifica informale in linguaggio naturale $P$ è descritta dal prodotto: $$P(C \mid P) = \prod_{t=1}^T P(c_t \mid c_{ [ V_func: PureTransformer ] | | │ | | ▼ | | [ V_inv: BoundaryCheck ] <-- [ V_type: ValidatedOutput ] | +-------------------------------------------------------------+ 3. Specificazione della Sintassi NDJSON-LD La scelta dello standard NDJSON-LD (Newline Delimited JSON-LD) garantisce tre proprietà computazionali ottimali per gli LLM: Streaming line-by-line deterministico: Ogni riga costituisce un'asserzione topologica autosufficiente, minimizzando la complessità dell'albero sintattico durante il parsing. Semantica formale esplicita (@context, @id, @type): Riduzione dell'ambiguità polisemica dei token. Compressione del footprint di contesto: Eliminazione dell'indentazione ricorsiva del JSON standard, massimizzando il throughput della context window. Schema formale di un record NDJSON-LD JSON Data format: RDF-Turtle JSON-LD JSON CSV RDF/XML Markdown RSS Atom {"@context": "https://schema.org/SoftwareSourceCode", "@id": "node:State", "@type": "TypeNode", "signature": "typing.NamedTuple", "properties": {"id": "UUID", "payload": "bytes"}} {"@context": "https://schema.org/SoftwareSourceCode", "@id": "node:Inv1", "@type": "InvariantNode", "predicate": "len(payload) <= 4096"} {"@context": "https://schema.org/SoftwareSourceCode", "@id": "edge:Transform", "@type": "HyperEdge", "sources": ["node:State"], "targets": ["node:Result"], "guards": ["node:Inv1"], "complexity": "O(N)"} 4. Architettura della Pipeline di Sintesi La pipeline di generazione si struttura su un processo deterministico a fasi sequenziali all'interno della medesima sessione di campionamento: Data format: RDF-Turtle JSON-LD JSON CSV RDF/XML Markdown RSS Atom +-------------------------------------------------------------------------+ | Prompt di Vincolo Epistemico + Requisiti Funzionali | +-------------------------------------------------------------------------+ │ ▼ +-------------------------------------------------------------------------+ | Generazione dell'Ipergrafo $H$ in NDJSON-LD | | (Allocazione di token per pianificazione topologica e contrattuale) | +-------------------------------------------------------------------------+ │ ▼ +-------------------------------------------------------------------------+ | Ordinamento Topologico degli Iperarchi | | (Risoluzione delle dipendenze $n$-arie dei nodi sorgente) | +-------------------------------------------------------------------------+ │ ▼ +-------------------------------------------------------------------------+ | Emissione del Codice Python Target | | (Implementazione di protocolli, tipi algebrici, contratti e runtime) | +-------------------------------------------------------------------------+ Regole di Traslazione $H \to \text{Python}$ Ogni $v \in V_{\text{type}}$ viene traslato in classi immutabili @dataclass(frozen=True) o typing.Protocol. Ogni $v \in V_{\text{inv}}$ viene mappato in asserzioni di runtime esplicite o clausole contrattuali (icontract / clausole di guardia). Ogni $e \in E$ viene compilato come funzione pura tipizzata staticamente con annotazioni rigorose (mypy --strict). 5. Analisi Comparativa Parametro di Valutazione Zero-Shot Diretto (P→C) Chain-of-Thought (CoT) Program Dependence Graph (PDG) NDJSON-LD Hypergraph (P→H→C) Modellazione Relazionale Implicita / Sequenziale Sequenziale informale Grafi binari ($\vert{}e\vert{}=2$) Ipergrafi $n$-ari ($\vert{}e\vert{} \ge 2$) Overhead di Parsing Assente Variabile (testo libero) Elevato (XML/DOT) Basso (NDJSON streaming) Preservazione Invarianti Bassa (Decadimento $t > 10^3$) Media Buona (strutturale) Elevata (vincolo esplicito) Allucinazione dei Tipi Elevata Media Bassa Minima (topologia chiusa) 6. Limiti Epistemologici e Protocollo di Falsificazione Per conferire al metodo validità scientifica, sono stabiliti i seguenti criteri di falsificabilità e limitazioni: Limiti intrinseci Complessità degli Iper-cicli: La presenza di dipendenze cicliche tra iperarchi $n$-ari non risolvibili genera blocchi logici che richiedono algoritmi di condensazione topologica a monte della compilazione. Consumo di Output Budget: La generazione dell'ipergrafo NDJSON-LD consuma tra il $20\%$ e il $40\%$ della finestra di generazione massima, limitando la dimensione netta del codice sintetizzabile in singolo turno. Protocollo Sperimentale di Validazione (Ablation Study) Il framework deve essere validato tramite un benchmark quantitativo strutturato come segue: Dataset di Test: SWE-bench Verified (500

View source

Similar papers

#large language models Open access Aug 2026

A Pattern Language for Production LLM Platforms: Governed Routing, Agent Orchestration, and AI-Native Delivery

A production platform built on large language models makes two kinds of decision, and most of its trouble comes from writing both into one clause. An optimization decision improves an objective: lower latency, lower cost, higher quality, fewer tests run. A boundary decision fixes a constraint that may not be relaxed for any gain: a residency rule, a least-privilege scope, a human-review threshold. When the two share a clause, improving one silently erodes the other, which is why efficiency and accountability are so often reported as a trade. This specification is built on one invariant: a boundary is a clause the optimizer may not cross, and everything else is optimization. The contribution is a cross-layer architectural method for separating non-negotiable constraints from adaptive optimization and binding both to reconstructable evidence, applied identically across model routing, agent orchestration and AI-native delivery. The seventeen patterns are instances of that method rather than the contribution itself. Each pattern is specified in the classical pattern form and carries three architectural declarations: the boundary it fixes, the optimizer it frees, and the evidence proving the boundary held. Every boundary is assigned to one of five classes covering data, authority, decision, resource and process constraints. Section 3 states the derivation method by which candidates were admitted or rejected, and publishes the rejections alongside the admissions so that the criterion can be examined rather than trusted. Three mechanisms make the language operate as a language rather than a list. A pattern relationship graph names which pattern supplies the artifact, evidence or authority another depends on, including the single cycle by which a workflow improves from its own structural record and the economic chain running the full height of the stack. A normative event identity, with rules for causal parentage, retries, provider boundaries and retention, turns the requirement that evidence be joinable into something an implementation can satisfy or fail. And per-pattern applicability conditions replace categorical requirements, so that a pattern governing a mechanism an institution does not operate is out of scope rather than a gap. Conformance is self-declared and published as a profile carrying the environment, the applicable set, per-pattern status, an evidence date and documented gaps. It is not a certification scheme, and no conformity assessment body operates against it. The contribution is architectural rather than empirical. Every pattern carries an evidence level, and no pattern reaches the highest level, because no implementation unconnected to the author has been evaluated. Nothing has been measured. The specification separates what would falsify the invariant from what would falsify an individual pattern and from what would falsify the composition and adoption sequence, poses six research questions, and records the absence of a real implementation profile as a known deficiency of version 1.0. An appendix reconciles the pattern identifiers with the names used across the author's papers and companion book series, including the acronyms PEVG and PARA, so that the two bodies of work can be cited as one. Version 1.1 names two constructs the specification already contained. The central proposition is named the Boundary Invariant, and the three architectural declarations required of every pattern are together named the BOE Declaration. Neither carries a trademark, both are offered for use with attribution under this document's licence, and neither changes any requirement: the proposition, its wording and its priority date are those of version 1.0. Section 11 gains the two-family naming convention and a precedence rule fixing which document governs where this specification and the Defensible AI Framework Registry describe the same relationship.

Nabeel Khan · 8 citations

Related blog posts

Microsoft Research Blog Aug 31, 2026

GigaPath-Flash and GigaTIME-Flash: Toward population-scale discovery with efficient pathology foundation models

What if pathology foundation models could do more with less? GigaPath-Flash and GigaTIME-Flash cut computational demands while maintaining strong performance, opening the door to larger studies and broader exploration. The post GigaPath-Flash and GigaTIME-Flash: Toward population-scale discovery with efficient pathology foundation models appeared first on Microsoft Research.