---
title: 'EditLens: AI Text & Graph Edit Framework'
url: https://www.emergentmind.com/topics/editlens-framework
type: topic
---

# EditLens: AI Text & Graph Edit Framework

The EditLens framework encompasses two major contributions: (1) quantitative detection of AI editing in textual documents using regression over similarity metrics, and (2) an interactive orthogonal edge-routing system for incremental graph editing. Both instances are characterized by their architectural integration of fast heuristics, incremental data structures, and rigorous measurement of editing operations, though they are applied in distinct domains (text versus graphs).

## 1. Problem Formulations in EditLens Frameworks

The EditLens textual framework operates in the homogeneous mixed-authorship regime, where a human-authored source $x \in \mathcal{X}$ is modified by an AI system into $y \in \mathcal{X}$, possibly through multiple passes. The central objective is not per-token attribution, but rather predicting a scalar $\hat{\Delta}(y) \in [0,1]$ as a continuous measure of the magnitude of AI editing in $y$ relative to $x$ [2510.03154, Sec. 2]. During training, parallel $(x, y)$ pairs are assumed; at inference, only $y$ is available.

By contrast, the graph-based EditLens is concerned with incremental editing operations—insertions, updates, and deletions of nodes and edges—in an existing orthogonal graph layout. Here, user intent is mediated via a “lens,” which suggests edits without disturbing the global structure unless necessary [1612.05064].

## 2. Methodological Foundations

### Textual Edit Quantification

EditLens quantifies AI editing using monotonic transformations of similarity metrics $sim(x, y) \in [0,1]$, setting $\Delta(x, y) = 1 - sim(x, y)$. Four classes of similarity metrics are employed for intermediate supervision [2510.03154, Sec. 3]:

- **Normalized Levenshtein distance**:
  $$ d_{\text{lev}}(x, y) = \frac{Lev(x, y)}{\max(|x|, |y|)} $$
- **Jaccard distance over unique token sets**:
  $$ d_{\text{jac}}(x, y) = 1 - \frac{|T(x) \cap T(y)|}{|T(x) \cup T(y)|} $$
- **Cosine distance over sentence embeddings**:
  $$ d_{\text{cos}}(x, y) = 1 - \frac{v_x \cdot v_y}{\|v_x\| \|v_y\|} $$
  where $v_x, v_y$ are generated by a pre-trained encoder (LINQ-Embed-Mistral).
- **Soft n-gram overlap (embedding-based ROUGE precision)**.

These metrics function as supervision signals for regression, correlating well with human-perceived AI-edit intensity (Krippendorff's $\alpha \approx 0.66$) [2510.03154, Sec. 3.3].

### Graph Edit Routing

The graph EditLens formalizes the problem as: given fixed nodes $V$ with disjoint geometry and connector points $C$, find orthogonal polylines $P_e$ for new or updated edges $E_{new}$ that minimize a cost:
$$ \text{Cost}(P_e) = \sum_i \|p_i - p_{i-1}\|_2 + \lambda \cdot (\# \text{bends in} \; P_e) $$
subject to obstacle constraints [1612.05064, Sec. 2.1].

Key data structures:
- **R-tree** for bounding-box spatial indexing over nodes
- **Orthogonal Visibility Graph (OVG)** where nodes are connector points and edges exist if orthogonal connections avoid node interiors

A* search with Manhattan heuristics over the OVG produces candidate routes, followed by local “nudging” to resolve geometric overlaps [1612.05064, Sec. 2.3].

## 3. System Architectures

### Textual EditLens

The model backbone is a pre-trained, open LLM such as Mistral-Small 24B or Llama-3.x, subject to parameter adaptation by QLoRA over linear projections in all MLP and self-attention blocks. The final representation $h \in \mathbb{R}^H$ from the classification token or pooled sequence output is layer-normalized and mapped to a regression output $\hat{y} = w^T h' + b$. No activation is used between normalization and output projection. Loss functions are mean squared error for regression and cross-entropy for $N$-way classification, with continuous outputs reconstructed via weighted bucket averages [2510.03154, Sec. 3.4 & App].

Training utilizes approximately $60,000$ $(x, y)$ triplets spanning six domains (e.g., Amazon reviews, XSum, Reddit, Enron mails), a broad set of LLMs for generating synthetic edits, and 303 human and model-composed editing prompts. Optimization is performed via AdamW at $3\cdot 10^{-5}$ learning rate with batch size 24 on 8$\times$A100 GPUs, targeting adapters and output heads [2510.03154, Sec. 3.1–3.4].

### Graph EditLens

Subsystems:
- **Placement Suggester**: Proposes candidate node locations by heuristics (e.g., edge length, crossing minimization)
- **Orthogonal Router**: Constructs and incrementally updates OVG, computes shortest orthogonal paths by A*
- **Layout Stabilizer**: Ensures local edits do not propagate alterations to unaffected layout regions

Edit operations—insert, update, and delete—are decomposed into parallelizable substeps ensuring sub-$100$ ms response times even for $300+$ node graphs [1612.05064, Sec. 1].

## 4. Quantitative Performance and Evaluation

### EditLens for Text

Performance across tasks:
- **Binary regression-to-classification (“any AI” vs “fully human”)**: $F_1 \approx 95.6\%$ (soft n-grams), exceeding Pangram ($F_1 \approx 83.7\%$)
- **Binary (AI vs rest)**: $F_1 \approx 94.1\%$ (cosine)
- **Ternary (human vs AI-edited vs AI-generated)**: macro-$F_1 \approx 90.4\%$ (cosine), compared to GPTZero’s $72.7\%$
- **Out-of-domain generalization**: $F_1$ remains robust, dropping from $0.904$ to $0.850$ on unseen LLMs, $0.866$ on out-of-domain data [2510.03154, Sec. 4].

Correlation with APT-Eval and other editing metrics (Pearson $r$ with Levenshtein $= 0.799$, Jaccard $= 0.781$) outperforms binary detectors ($r<0.35$).

### EditLens for Graphs

The orthogonal router achieves:
- Insertion of one node plus two edges in $\approx 0.4$ ms for $N=50$ to $N=600$ nodes (constant latency)
- Quality: edge polyline length and bend count competitive with Wybrow et al.; route stability at $100\%$
- In contrast, Wybrow et al. display runtime increases from $10$ ms (N=50) to $20$ s (N=600) [1612.05064, Sec. 4].

## 5. Applications and Limitations

### Textual EditLens

**Applications**:
- **Authorship attribution**: Provides a continuous, non-binary measure resilient to scenarios of mild AI assistance
- **Educational contexts**: Distinguishes grammatical refinement from substantive rewriting by AI
- **Policy compliance**: Enables enforcement of AI-editing budgets [2510.03154, Sec. 6]

**Limitations**:
- Single-pass, single-model AI edits; does not handle layered human–AI workflows
- No chunk- or token-level granularity
- Vulnerable to adversarial paraphrase attacks [2510.03154, Sec. 6]

*This suggests that real-world deployment for fine-grained or adversarial settings may require substantial extensions.*

### Graph EditLens

**Applications**:
- Interactive graph editing for large node-link diagrams where rapid, stable, and orthogonally routed edits are critical

**Limitations**:
- Quadratic OVG memory footprint in $|C|$; random nudging is not always overlap-free
- Not yet incorporating recent ultra-fast routing approaches that could further lower runtime constants [1612.05064, Sec. 4]

## 6. Case Study and Empirical Validation

A large-scale analysis on real-world AI edits via the Grammarly interface confirmed alignment between EditLens scalar outputs and intuitive prompt severity. For nine default prompts (“Fix any mistakes,” “Summarize this,” “Make it more detailed,” etc.), median edit magnitudes ranged from $\approx 0.05$ (minor fixes) to $0.4$–$0.5$ (summarization, major detail changes), and both soft n-gram and cosine-based models yielded identical qualitative rankings across prompts [2510.03154, Sec. 4.7].

Annotators' judgments further validated that similarity-based $\Delta$ scores approximate human perception of AI edit intensity, supporting the suitability of the chosen similarity metrics for supervision.

## 7. Future Directions

EditLens research identifies several promising extensions:
- Handling multi-pass, heterogeneous human–AI editing workflows
- Region-level edit quantification (subspan $\Delta$)
- Incorporation of richer linguistic/discourse features
- Robustness to adversarial paraphrasing, watermark removal, and prompt-engineering strategies [2510.03154, Sec. 6]
- In the graph domain, OVG compression and deterministic local nudging are anticipated to improve scalability and robustness [1612.05064, Sec. 4].

A plausible implication is that both textual and graph-based EditLens frameworks are adaptable to broader classes of mixed-origin, incrementally edited artifacts provided appropriate data structures and task-specific supervision metrics are developed.

Source: https://www.emergentmind.com/topics/editlens-framework