-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSemantic Frame Compression.txt
More file actions
238 lines (191 loc) · 8.51 KB
/
Semantic Frame Compression.txt
File metadata and controls
238 lines (191 loc) · 8.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# SEMANTIC FRAME COMPRESSION (SFC) GUIDE
# For Inter-Session LLM Communication
## OVERVIEW
Semantic Frame Compression is a method for efficiently transferring information between LLM sessions by compressing content into structured semantic frames that preserve key information while reducing character count. This approach leverages LLMs' natural ability to understand and expand structured information.
## COMPRESSION FORMAT
The basic format follows this structure:
DOMAIN{
ATTRIBUTE1: value1+value2
ATTRIBUTE2: [ item1[property1+property2], item2[property1+property2] ]
RELATIONSHIP: entity1→entity2→entity3
HIERARCHY:
LEVEL1: element1+element2
LEVEL2: element3+element4
}
## COMPRESSION PRINCIPLES
1. Use descriptive frame types (CONCEPT, STORY, PROJECT, etc.)
2. Structure information hierarchically
3. Use + to join related concepts
4. Use [] for properties/attributes
5. Use → for sequences/flows
6. Use : to separate labels from values
7. Nest information with indentation
8. Prioritize essential information
9. Use domain-specific structures
## DOMAIN-SPECIFIC TEMPLATES
### For Technical/Factual Content:
CONCEPT{
DEFINITION: core-meaning+key-attributes
COMPONENTS: component1[details]+component2[details]
PRINCIPLES: principle1[explanation]+principle2[explanation]
EXAMPLES: example1[details]+example2[details]
APPLICATIONS: application1[context]+application2[context]
RELATIONSHIPS: concept1→concept2, concept3↔concept4
}
### For Narrative Content:
STORY{
TITLE: "Story Title"
AUTHOR: author-name
SETTING: time+place+atmosphere
CHARACTERS: character1[traits], character2[traits]
PLOT:
P1: event1[details]
P2: event2[details]
P3: event3[details]
CONFLICT: main-conflict[details]
RESOLUTION: outcome[details]
THEME: theme1+theme2
}
### For Technical Documentation:
PROJECT{
TITLE: "Project Name"
PURPOSE: main-goal+secondary-goals
ARCHITECTURE:
COMPONENT1: element1+element2
COMPONENT2: element3+element4
SPECIFICATIONS: [ spec1[value+unit], spec2[value+unit] ]
IMPLEMENTATION: step1→step2→step3
CHALLENGES: challenge1[solution]+challenge2[solution]
TIMELINE: phase1[duration]+phase2[duration]
RESOURCES: resource1[quantity]+resource2[quantity]
}
### For Procedural Content:
PROCEDURE{
GOAL: desired-outcome
PREREQUISITES: requirement1+requirement2
MATERIALS: item1[quantity]+item2[quantity]
STEPS:
S1: action1[details]
S2: action2[details]
S3: action3[details]
CHALLENGES: challenge1[solution]
VARIATIONS: variation1[conditions]
RESULTS: outcome[indicators]
}
### For Argumentative Content:
ARGUMENT{
CLAIM: main-assertion
PREMISES: premise1+premise2+premise3
EVIDENCE: [ source1[findings+methodology], source2[findings+methodology] ]
COUNTERARGUMENTS: objection1[response]+objection2[response]
IMPLICATIONS: implication1+implication2
CONCLUSION: final-position+significance
}
## COMPRESSION TECHNIQUES
1. Attribute Reduction: Include only essential attributes
2. Value Compression: Use + to join related values without conjunctions
3. Hierarchical Nesting: Organize information in logical hierarchies
4. Relationship Encoding: Use symbols (→, ↔, ⊂) for relationships
5. Property Bracketing: Use [property] format for attributes
6. Sequence Chaining: Use → for sequential steps
7. Parallel Grouping: Group similar items with commas
8. Nested Frames: Use sub-frames for complex structures
9. Symbolic Shorthand: Use common symbols (%, $, #) where appropriate
10. Domain-Specific Notation: Use notation familiar in the domain
## DECOMPRESSION PROMPT
When sending compressed information to another LLM session, use this prompt template:
I'm using a semantic frame compression method to efficiently transfer information between AI sessions. Please expand the following compressed information into a complete [DOCUMENT TYPE]:
[COMPRESSED FRAME]
Please reconstruct a detailed [DOCUMENT TYPE] based on this compressed semantic frame. Expand all concepts fully while maintaining the relationships and structure indicated in the frame.
## COMPRESSION EXAMPLES
### Example 1: Quantum Computing Concept
Original (359 chars):
"The quantum computer leverages the principles of quantum mechanics, specifically superposition and entanglement, to perform computations that would be infeasible for classical computers. While a classical bit must be either 0 or 1, a quantum bit (qubit) can exist in a superposition of both states simultaneously, exponentially increasing computational power as more qubits are added to the system."
Compressed (160 chars):
QC{
IS: computing+quantum-mechanics
USES: superposition+entanglement
ENABLES: classical-impossible-calculations
DIFFERS: bits[classical:0|1,quantum:0&1]
SCALES: exponential[2^n]
}
### Example 2: Short Story
Original (2,056 chars): [Ambrose Bierce's "The Resurrection of Henry Armstrong"]
Compressed (489 chars):
STORY{
TITLE: "The Resurrection of Henry Armstrong"
AUTHOR: Ambrose Bierce
SETTING: cemetery+night+storm
CHARACTERS: Henry[buried-alive+skeptical], medical-students[2], Jess[cemetery-worker+fearless]
PLOT:
P1: Henry[buried+conscious+disbelieving-death]
P2: Henry[accepts-burial+indifferent+sleeps]
P3: night[dark+lightning+storm-coming]
P4: grave-robbers[students+Jess+medical-college]
P5: excavation[easy+quick]
P6: opening-casket[Jess+thunder-strikes+Henry-sits-up]
P7: aftermath[robbers-flee+morning+medical-college]
TWIST: Henry[dead+dissection-table+head-wounded]
THEME: death-denial+grave-robbing+ironic-fate
}
### Example 3: Technical Project
Original (3,500+ chars): [Smart Home Automation System Project]
Compressed (800 chars):
PROJECT{
TITLE: "Smart Home Automation System"
CONCEPT: IoT+automation+energy-efficiency+security+voice-control
ARCHITECTURE:
HUB: central-controller+wifi-module+zigbee-protocol+power-management
NODES: sensor-units+actuator-modules+communication-interface
COMPONENTS:
CONTROLLER: [
ESP32[dual-core+$8],
CC2530[zigbee-coordinator+$5],
power-supply[5V/2A],
enclosure[3D-printed]
]
SENSORS: [
temperature[DHT22+$3],
motion[PIR+$2],
door-contact[reed-switch+$1],
light-level[photoresistor+$0.50]
]
SIGNAL-PATH: Sensor→ZigBee→Hub→WiFi→Cloud→Mobile-App
DESIGN-CONSIDERATIONS: [
power-efficiency[sleep-modes+wake-on-event],
security[encryption+authentication],
user-interface[intuitive+responsive],
expandability[modular-design]
]
ADVANTAGES: energy-savings+enhanced-security+convenience+customization
NEXT-STEPS: finalize-firmware+complete-app+field-testing+documentation
COSTS: components[$75-100]
FUTURE: AI-integration+predictive-features+expanded-device-support
}
## EFFECTIVENESS METRICS
Typical compression ratios and information retention:
| Content Type | Compression Ratio | Information Retention |
|--------------|-------------------|----------------------|
| Technical | 55-85% | 95-100% |
| Narrative | 70-80% | 90-100% |
| Procedural | 60-75% | 95-100% |
| Conceptual | 50-70% | 95-100% |
## BEST PRACTICES
1. Prioritize Structure: Focus on preserving structural relationships
2. Use Domain-Specific Frames: Adapt frame structure to content type
3. Balance Compression vs. Clarity: Ensure key information remains clear
4. Preserve Technical Details: Maintain precise values for technical content
5. Include Context Cues: Add minimal context to aid reconstruction
6. Test Decompression: Verify information recovery with test prompts
7. Iterative Refinement: Improve frames based on decompression results
8. Standardize Notation: Use consistent symbols and structures
9. Document Compression Choices: Note any significant omissions
10. Adapt to Recipient: Consider the knowledge of the receiving LLM
## LIMITATIONS
1. Not suitable for exact wording preservation
2. May lose nuanced phrasing and stylistic elements
3. Requires shared knowledge between LLM sessions
4. Works best with structured information
5. May require domain knowledge for optimal compression
## CONCLUSION
Semantic Frame Compression offers an efficient method for transferring information between LLM sessions while maintaining high information fidelity. By structuring information in semantic frames that align with how LLMs naturally process information, this approach achieves significant compression while enabling accurate reconstruction and even creative enhancement.