Jaiccc commited on
Commit
0b20013
·
verified ·
1 Parent(s): 7e81101

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +20 -30
README.md CHANGED
@@ -21,43 +21,33 @@ The dataset is provided in `JSONL` format, mapped specifically for conversationa
21
  "input": "### CONTEXT (Previous Events):\n<system_output timestamp=\"10.01\">demo@server:~$ apt update</system_output>\n<system_output timestamp=\"10.05\">Reading package lists...</system_output>\n\n### TARGET LINE:\n<user_input timestamp=\"12.40\">s</user_input>",
22
  "output": "12.40, old event"
23
  }
24
- 🎯 The Model's Goal
25
- The primary objective of the model is binary classification of sequential data. By looking at the historical context (e.g., "The terminal has been downloading packages for the last 14 steps"), the model must predict if the timestamp in the Target Line breaks that pattern and establishes a new boundary (e.g., "The download finished and the shell prompt returned").
26
 
27
- ✂️ Rules of Truncation
28
- Raw terminal logs (like apt-get installations) can easily overflow an LLM's context window. To prevent this, the data engineering pipeline applies a strict Two-Phase Truncation rule:
29
 
30
- Phase 1: Intra-Chunk Truncation (Line Limit)
31
- If a single <system_output> block contains more than 15 lines of text, it is sliced. The first 5 lines and the last 5 lines are preserved, and the middle is replaced with a marker: ... [TRUNCATED X LINES] .... Note that <user_input> tags are never truncated to preserve human-interaction signals.
32
 
33
- Phase 2: Window-Level Compression (Context Limit)
34
- If the entire 14-chunk context window exceeds 25 total lines, the window is compressed:
35
-
36
- The 5 oldest chunks and the 5 most recent chunks are kept fully intact.
37
-
38
- For the chunks in the middle, the text is completely stripped out, leaving only the XML tags (e.g., <system_output timestamp="X">... [TRUNCATED TO SAVE SPACE] ...</system_output>).
39
- This preserves the chronological timeline and sequence of events without bloating the token count.
40
 
41
- Data Sampling & Balancing
42
- In a typical terminal log, over 95% of the lines are "Old Events" (continuous output or typing), which would lead the model to simply guess the majority class. To force actual learning, this dataset uses Negative Downsampling:
43
 
44
- New Events (Positives): 100% of detected boundaries are kept.
 
45
 
46
- Old Events (Negatives): Downsampled so that there is exactly a 2:1 ratio (Two old events for every one new event).
47
-
48
- Hard Negative Mining
49
- When selecting which "Old Events" to keep for the 2:1 ratio, the algorithm prioritizes Hard Negatives. Specifically, it targets <user_input> tags that contain a newline character (\n). This teaches the model the difficult lesson that a user pressing "Enter" is often just a completion of an input phase, not necessarily a new logical event.
 
50
 
51
- 💻 How to Load the Dataset
52
- You can load this dataset directly in Python using the Hugging Face datasets library:
53
 
54
- Python
55
- from datasets import load_dataset
56
 
57
- # Load the dataset
58
- dataset = load_dataset("Jaiccc/model0_boundary_predict_streaming", split="train")
59
 
60
- # Optional: Split into training and validation
61
- split = dataset.train_test_split(test_size=0.1, seed=42)
62
- train_dataset = split["train"]
63
- eval_dataset = split["test"]
 
21
  "input": "### CONTEXT (Previous Events):\n<system_output timestamp=\"10.01\">demo@server:~$ apt update</system_output>\n<system_output timestamp=\"10.05\">Reading package lists...</system_output>\n\n### TARGET LINE:\n<user_input timestamp=\"12.40\">s</user_input>",
22
  "output": "12.40, old event"
23
  }
 
 
24
 
25
+ ---
 
26
 
27
+ ### 🎯 The Model's Goal
28
+ The primary objective of the model is **binary classification of sequential data**. By looking at the historical context (e.g., "The terminal has been downloading packages for the last 14 steps"), the model must predict if the timestamp in the Target Line breaks that pattern and establishes a new boundary (e.g., "The download finished and the shell prompt returned").
29
 
30
+ ---
 
 
 
 
 
 
31
 
32
+ ### ✂Rules of Truncation
33
+ Raw terminal logs (like `apt-get` installations) can easily overflow an LLM's context window. To prevent this, the data engineering pipeline applies a strict **Two-Phase Truncation** rule:
34
 
35
+ #### Phase 1: Intra-Chunk Truncation (Line Limit)
36
+ If a single `<system_output>` block contains more than 15 lines of text, it is sliced. The first 5 lines and the last 5 lines are preserved, and the middle is replaced with a marker: `... [TRUNCATED X LINES] ...`. Note that `<user_input>` tags are **never** truncated to preserve human-interaction signals.
37
 
38
+ #### Phase 2: Window-Level Compression (Context Limit)
39
+ If the entire 14-chunk context window exceeds 25 total lines, the window is compressed:
40
+ * The **5 oldest chunks** and the **5 most recent chunks** are kept fully intact.
41
+ * For the chunks in the **middle**, the text is completely stripped out, leaving only the XML tags (e.g., `<system_output timestamp="X">... [TRUNCATED TO SAVE SPACE] ...</system_output>`).
42
+ * This preserves the chronological timeline and sequence of events without bloating the token count.
43
 
44
+ ---
 
45
 
46
+ ### ⚖️ Data Sampling & Balancing
47
+ In a typical terminal log, over 95% of the lines are "Old Events," which would lead the model to simply guess the majority class. To force actual learning, this dataset uses **Negative Downsampling**:
48
 
49
+ * **New Events (Positives):** 100% of detected boundaries are kept.
50
+ * **Old Events (Negatives):** Downsampled so that there is exactly a **2:1 ratio** (Two old events for every one new event).
51
 
52
+ #### Hard Negative Mining
53
+ When selecting which "Old Events" to keep for the 2:1 ratio, the algorithm prioritizes **Hard Negatives**. Specifically, it targets `<user_input>` tags that contain a newline character (`\n`). This teaches the model the difficult lesson that a user pressing "Enter" is often just a completion of an input phase, not necessarily a new logical event.