Came across @eddiejiaoobj’s launch of Common Knowledge today:
Now, Machine Intelligence gives us a new material – one whose inherent malleability allows us to invent entirely new categories of document. How will these new documents allow us to create, share, and collaborate in new ways?
And then remembered a few tweets about AI-friendly frameworks:
I think it will also impact the libraries and frameworks people choose for new products
— Charles Williamson (@CFJWilliamson) September 12, 2024
Tailwind with AI seems to work particularly well for me because the styling context is in the same file
I was too skeptical about Tailwind. I thought it would be like Bootstrap, comes and goes. But when I saw almost all LLMs were trained on Tailwind, I switched to it. If you know Tailwind and use Cursor for example, you'll be building web-apps couple of times faster.
— Ozgur Ozer (@ozgrozer) January 29, 2025
It’s evident that AI favors frameworks like Tailwind and React, but I hadn’t thought as much about the file format layer. I was recently trying to convert CSVs using various models and the results were surprisingly lackluster — reasoning models like ChatGPT o1 and DeepSeek r1 would forget to convert particular cells or get into logic loops trying to write and rewrite code that could interpret the input CSV.
Non-reasoning models actually did better, particularly ones that I specified should not write code at all. But then the challenge was getting the model to output the correct number of commas in each row to put the right data in each column.
AI prompts and responses are heavily reliant on Markdown formatting, and there’s evidence that Markdown can help improve understanding of prompts. It understands XML well, and is getting better at JSON.
I’m sure understanding of CSVs will improve, though I wonder if they’ll need to be considered more like images, given their 2D nature, than text. Is there even a large enough training set for CSVs?
And then finally, I wonder if Microsoft will train models on a corpus of Office docs — .docx, .xlsx, and .pptx. As far as I can tell with Microsoft 365 Copilot, the AI is either generating standard text or markdown markup that is then opened in Microsoft Office (screenshot), or helping with text generation within the application itself. Behind the scenes those formats have a shared Office Open XML markup, but maybe the bigger issue is bundling files as a ZIP?
If you ask o1 to generate a simple Word document, it thinks for a few minutes:
Crafting the document request
I’m figuring out how to generate a landscape-oriented Word document featuring “Hi there” and considering methods for providing it since attachments or base64 encoding are not options.
Assessing options
I’m thinking through creating a base64-encoded docx file or a minimal Open XML document, which the user can rename to .docx, as direct attachments aren’t feasible.
Crafting a Word doc
I’m set to create a minimal Word doc featuring “Hi there” in landscape orientation, then encode it into a base64 string or provide raw text for users to save as a docx file.
Preparing a solution
I’m thinking about crafting minimal Word doc instructions or a raw text file with “Hi there” for users to convert to docx, simplifying the process with clear guidance or a base64-encoded string.
Crafting the document
I’ll create a minimal Word doc, set the orientation to landscape, open it as a zip, and encode it into a base64 string, ensuring it aligns with the user’s request.
Forming the structure
I’m crafting an OOXML snippet for a minimal Word document, ensuring it includes necessary elements like <w:document> and references to styles. This requires precision to meet the standard structure.
Organizing the essentials
I’m organizing the necessary XML files for a minimal Word document, including ContentTypes.xml, rels/.rels, and word/document.xml, ensuring a correct directory structure for packaging.
Creating and encoding
I’ll compress the XML files into a .zip, rename it to .docx, and encode it into a base64 string. This method involves generating the document logically and encoding it for user access.
Compressing and renaming
I’m piecing together the XML files into a .zip, renaming it to .docx, and base64 encoding the .docx, ensuring a compact and efficient format following the user’s instructions.
Renaming and encoding
I’m renaming the .zip to LandscapeHiThere.docx and preparing to encode it into a base64 string. This step ensures the document’s format aligns with the user’s request, focusing on maintaining accuracy and efficiency.
Replicating the compression algorithm
I’m considering the feasibility of replicating the compression algorithm for generating a Word document. This involves constructing a minimal doc and encoding it into a base64 string for the user.
Simplifying the process
I’m considering a minimal doc with only three files, encoding it into a base64 string, and providing instructions for decoding to streamline the process, avoiding unnecessary complexity.
Nailing down the method
I’m thinking through providing instructions for generating a Word document in landscape orientation with ‘Hi there’ text, as this seems simpler than creating an entire .docx file.
Generating the document structure
I’m crafting a minimal docx by creating essential files—Document.xml, ContentTypes.xml, and rels/.rels—zipping them, and then encoding the zip into a base64 string.
Weighing options
I’m considering providing a concise method for creating a Word document in landscape orientation with ‘Hi there’ text, or a base64 encoded snippet for decoding, to streamline the process.
Moving forward
I’m weighing whether providing instructions or a base64-encoded zip file is more efficient. Despite the base64 approach being sizable, I’ll proceed for thoroughness.
Crafting helpful instructions
I’m pulling together detailed instructions for decoding a base64-encoded zip file, including copying the text, decoding securely, renaming, and opening in Microsoft Word for ease of use.
Laying out the options
I’m organizing details on creating three essential XML files for a Word docx, focusing on the file structure and content, and assessing potential compression and base64 encoding sizes.
Balancing options
I’m piecing together the base64 and instructions for creating a Word docx. The collaboration to merge them will ensure comprehensive guidance for the user.
And finally gives you a few possible solutions:
Below you’ll find two ways to get a landscape-oriented Word document containing the text “Hi there.”
Option 1: Simple Step-by-Step Instructions
- Open Microsoft Word (or a compatible word processor).
- Switch the page orientation to Landscape:
- Type the text: Hi there
That’s it! You now have a Word document in landscape orientation that says “Hi there.”
Option 2: Downloadable (Base64-Encoded) Minimal DOCX
Below is a minimal Word document (in .docx format) encoded in Base64. It has exactly one paragraph that says “Hi there,” with its page set to landscape orientation.
Instructions to use it:
UEsDBBQABgAIAAAAIQDcZAUiYwEAAHsBAAAQAAAAW0NvbnRlbnRfVHlwZXMuXML7Wd1LFgUBf0q/Sm2hh0M1fApTTZQKepItpOeIo5gSO7g0jhPyPR4awMl3ggjdSS9/6HixzECAPQyB+x3D72bDY0+toYZpVCya3ke5EekQ4irjrJEKvK5ruxsj8L12cxhjTe9vJDv4R7N5vkcz9xaqGpTeABvEUfPFmyK+DmlrXujwSWVFFbeLRvZEzxBQSwMEFAAGAAgAAAAhANxkBSJjAQAAcwIAAAsAAABfcmVscy8ucmVsc7VQz07DIBDdBf8g7CeaNsHawKKA7sgDRylmOFGzo2tRSbPXr+RbN2aAwPGHInsJPe8P5HIC8qlIQDXRIS09ycymYsRsxzghm2lBKP8dc5UBsxm1jtKPYZ6rAa4uUHckkHvcznGgSSN7yhQU/Ez1Z/hEW72exOl/yybv5Ys6TtFKR+Mpcblhx2acUl44K0xuYS/rXdpwXLk+//OfBUEsDBBQABgAIAAAAIQDcZAUiYwEAAeQGAABcAAAAd29yZC9kb2N1bWVudC54bWyVbU+bMBC951eIbAXeGh2UE4oB6CLBAK7UBbqDUaTZ9OWhgpcv1pZcN0DJF/+9qymhktNcxlLb8/XePyYiI+7Z9719+os8DQEjJ2PizLAeqKhCeQTdXKqgzk2QbEF72/P6zpcB3+TOYXpxB34Frhxjpw4S4nyTxyoCxyI5IR9sL/nKZfnct9ZU2M0Okai0RG29V2GJTuqAJakdW3gvxqAHw0xXrL47xdl1GOSFy7y9uuDAvOWhrfdHZ7t8SeT53nFlXiNo9ZJV4Q6gkHaoERNoBpJShHbkZb02lCU3PbNTeDbqhS4PbkAl6lv1CCqqnPJSh4+bCl556TizP4GCvI9b47+T1/HZkPBcuvYJsOv2YVGzE6aZ/gNedcJbPmzrqdncHz8+z8moPC/YznE/D8isGhPNM/MvOv0zNv8855evD8r1QsDB5+tx70hyeDwEzSDEz2N6knV6SfJvO+DJ8AUEsBAhQDFAAGAAgAAAAhANxkBSJjAQAAewEAAAQAAAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzLnhtbFBLAQIUAxQABgAIAAAAIQDcZAUiYwEAAHMCAAALAAAAAAAAAAAAAAAAAC8AAABfcmVscy8ucmVsc1BLAQIUAxQABgAIAAAAIQDcZAUiYwEAAeQGAABcAAAAAAAAAAAAAAAAAHsAAAB3b3JkL2RvY3VtZW50LnhtbFBLBQYAAAAAAwADALcAAADnBgAAAAA=
Verifying it works
Enjoy your landscape Word document!
4o does better, writing the following code:
from docx import Document
from docx.shared import Inches
from docx.enum.section import WD_ORIENT
# Create a new Word document
doc = Document()
# Change page orientation to landscape
section = doc.sections[0]
section.orientation = WD_ORIENT.LANDSCAPE
new_width, new_height = section.page_height, section.page_width
section.page_width = new_width
section.page_height = new_height
# Add text to the document
doc.add_paragraph("Hi there")
# Save the document
file_path = "/mnt/data/Hi_there_landscape.docx"
doc.save(file_path)
file_path
We’ll get to AI-native file formats that are more accurate and have higher information density / bits per second transmission speed. But I can’t help but wonder why, given the hundreds of billions of Office docs created each year, it can’t output or manipulate them more easily.
Leave a Reply