From 86335ac64f859ebc5db0ee4e9b09aa403563de40 Mon Sep 17 00:00:00 2001 From: Aniketchavan7 <91446947+Aniketchavan7@users.noreply.github.com> Date: Sun, 22 Nov 2026 20:26:08 +0530 Subject: [PATCH] docs(chunking): specify semantic chunking via embedding gradient distance Methodology for dynamic document segmentation using cosine distance peaks across consecutive sentence embeddings. --- docs/retrieval/SEMANTIC_CHUNKING_METHODOLOGY.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 docs/retrieval/SEMANTIC_CHUNKING_METHODOLOGY.md diff --git a/docs/retrieval/SEMANTIC_CHUNKING_METHODOLOGY.md b/docs/retrieval/SEMANTIC_CHUNKING_METHODOLOGY.md new file mode 100644 index 0000000..82b4f45 --- /dev/null +++ b/docs/retrieval/SEMANTIC_CHUNKING_METHODOLOGY.md @@ -0,0 +1,10 @@ +# Retrieval Methodology: Semantic Chunking via Embedding Gradient Distance + +## 1. Motivation +Traditional fixed-token chunking splits sentences across arbitrary paragraph boundaries, separating related premises from conclusions. Semantic chunking identifies topic shifts naturally. + +## 2. Gradient Boundary Detection +Given sentences $S_1, S_2, \dots, S_n$ with embeddings $e_1, e_2, \dots, e_n$: +1. Calculate consecutive cosine distance: $d_i = 1 - \cos(e_i, e_{i+1})$. +2. Compute moving average $\mu_d$ and standard deviation $\sigma_d$. +3. Declare split boundary at index $i$ if $d_i > \mu_d + k \cdot \sigma_d$ (where $k = 1.2$).