https://www.boundaryml.com logo
🟡 Structuring dynamic sections from transcripts f...
# questions
d
I'm trying to convert a long YouTube transcript or podcast into a blog post. My approach is to divide the labour rather than using a single one-shot prompt because I tried both & dividing the labor gets me accurate/better output. My plan is to first have a process that breaks the transcript down into logical topics, creating Section A, Section B, Section C, and so on. Then, I'll have another process write the content for each section individually. My question is about the bridge between these two steps: What is the best way to structure the output for Section A, Section B, etc.? How should I represent these divided sections so that I can easily and reliably assemble them in the correct order to create the final blog post? The problem is these sections are dynamic. Also, what would be the data structure for this? I was thinking of putting in array but the sections can be sometimes 3 or sometimes 7 or sometimes 13 so totally random.
g
Great question. The first thing I would try would be slightly less work division: exactly two steps. step 1: build an outline as structured data Step 2: produce a blog post from the transcript and the outline class Outline { title string sections Section[] } class Section { header string? description string } function MkOutline(source: string) -> Outline {…} function MkBlogPost(source: string, outline: Outline) -> string { … } This way, the LLM responsible for the final post is aware of the long-range dependencies and you should get a more coherent post. At the same time, no LLM function has to return Freeform text and structured data in the same response (mixing the two is hard for LLMs and hard for the parser).
d
I've tested what I said myself via Chat, not API plus 2 people in the AI world who are like experts at this recommend Division of Labor (namely Mike Taylor of saxifrage.xyz, every.to, askrally.com in his book with Oreilly & Greg Kamradt of ArcAGI in his Maven course) & they've done 100s of test using API, especially Mike. That's why I went with division of labor. And I've tested to see that the output is defo better when I see division of labor & then expansion on it. Otherwise it misses some core insights in the post that are much needed. There's some missing insights when I do what u recommend. So my question is that is this something u've personally tested on or seen it in examples/use-cases of BAML???
g
I haven’t tested this myself, just going on intuition. If subdividing more works better, that’s a useful datapoint for me! So in your original question you asked about data structures for the post, given the complexity that each post may have different numbers of sections, is that right? Does the data structure I listed above solve that issue for you (ignoring my suggestion about consolidating all the section-writing into a single LLM call)? Happy to hack on this on a call together sometime if you’d like 🙂
d
Oh cool, I like ur insights on the data part (i feel like its the same as https://docs.boundaryml.com/examples/prompt-engineering/action-item-extraction which i found after posting this q) & I also asked different LLMs & it did gave me a decent direction. Lemme try to implement this. I feel like I need to A/B test 2 versions: 1. Urs (needs 2-3 calls only) 2. Divide & Labor (need 8-10 calls) to see for myself which one is actually better. Urs actually will fire lower calls. Ur idea makes sense but only Gemini 2.5 Pro sticks to it (Claude does too but that's expensive) & everyone else loses it halfway. I dont really like calls. But yeah I'll test this & will let ya know how it goes.