<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Lambdo Blog]]></title><description><![CDATA[software, ai and experiences]]></description><link>https://blog.lambdo.com/</link><image><url>https://blog.lambdo.com/favicon.png</url><title>Lambdo Blog</title><link>https://blog.lambdo.com/</link></image><generator>Ghost 5.80</generator><lastBuildDate>Tue, 14 Jul 2026 20:42:06 GMT</lastBuildDate><atom:link href="https://blog.lambdo.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Reproducible Production Docker Builds with Devbox and Nixery]]></title><description><![CDATA[<h1 id></h1><p>One of the issues I run into with docker is the constant lack of reproducibility. During development I&apos;ve solved this by using <a href="https://github.com/jetify-com/devbox?ref=blog.lambdo.com" rel="noreferrer">devbox</a>. Devbox doesn&apos;t solve this efficiently out of the box with their generated dockerfile. And using nix directly is not for the faint of</p>]]></description><link>https://blog.lambdo.com/reproducible-docker-builds-with-devbox-and-nixery/</link><guid isPermaLink="false">68701ed0f8722d0001d10b2f</guid><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Thu, 10 Jul 2025 20:29:53 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDJ8fGRvY2tlcnxlbnwwfHx8fDE3NTIxNzkzNjl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<h1 id></h1><img src="https://images.unsplash.com/photo-1605745341112-85968b19335b?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDJ8fGRvY2tlcnxlbnwwfHx8fDE3NTIxNzkzNjl8MA&amp;ixlib=rb-4.1.0&amp;q=80&amp;w=2000" alt="Reproducible Production Docker Builds with Devbox and Nixery"><p>One of the issues I run into with docker is the constant lack of reproducibility. During development I&apos;ve solved this by using <a href="https://github.com/jetify-com/devbox?ref=blog.lambdo.com" rel="noreferrer">devbox</a>. Devbox doesn&apos;t solve this efficiently out of the box with their generated dockerfile. And using nix directly is not for the faint of heart.</p><p>I&apos;ve been working on this problem and found a decent workaround using Devbox and Nixery that actually works.</p><h2 id="the-problem">The Problem</h2><ul><li>Docker builds aren&apos;t reproducible (based on ubuntu, alpine etc)</li><li>Devbox generated dockerfiles don&apos;t take advantage of buildLayeredImage in nix</li><li>It doesn&apos;t make sense for the team to learn nix (that&apos;s why we use devbox)</li></ul><h2 id="the-solution">The Solution</h2><p>Basically you can base your Dockerfile around Nixery using the devbox.lock commits for each package. This gives you the benefits of Nix&apos;s <code>buildLayeredImage</code> without having to write Nix code.</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://nixery.dev/?ref=blog.lambdo.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Nixery</div><div class="kg-bookmark-description">The Virus Lounge</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://static.ghost.org/v5.0.0/images/link-icon.svg" alt="Reproducible Production Docker Builds with Devbox and Nixery"></div></div><div class="kg-bookmark-thumbnail"><img src="https://nixery.dev/nixery-logo.png" alt="Reproducible Production Docker Builds with Devbox and Nixery"></div></a></figure><p>The <code>devbox.json</code> :</p><pre><code class="language-json">{
    &quot;packages&quot;: [
        &quot;elixir@latest&quot;,
        &quot;nodejs@latest&quot;,
        &quot;postgresql@latest&quot;,
        &quot;ffmpeg@latest&quot;
    ]
}
</code></pre><p>Then generate a Dockerfile that looks like this:</p><pre><code class="language-dockerfile"># Stage 1: Start with shell base
FROM nixery.dev/shell:076e8c6678d8c54204abcb4b1b14c366835a58bb AS base

# Stage 2: Elixir
FROM nixery.dev/elixir:7cc0bff31a3a705d3ac4fdceb030a17239412210 AS elixir-layer

# Stage 3: Node.js
FROM nixery.dev/nodejs:076e8c6678d8c54204abcb4b1b14c366835a58bb AS nodejs-layer

# Final stage: Use base and add packages
FROM base

# Copy nix store from each package stage
COPY --from=elixir-layer /nix /nix
COPY --from=nodejs-layer /nix /nix

# Create a profile directory and symlink all packages
RUN mkdir -p /nix/var/nix/profiles/default/bin &amp;&amp; \
    for store_path in /nix/store/*; do \
        if [ -d &quot;$store_path/bin&quot; ]; then \
            for binary in &quot;$store_path/bin&quot;/*; do \
                [ -f &quot;$binary&quot; ] &amp;&amp; ln -sf &quot;$binary&quot; &quot;/nix/var/nix/profiles/default/bin/$(basename &quot;$binary&quot;)&quot; || true; \
            done; \
        fi; \
    done

ENV PATH=/nix/var/nix/profiles/default/bin:/bin:/usr/bin
WORKDIR /app
</code></pre><p>The magic is in those commit hashes. They come from your <code>devbox.lock</code> file, so every build uses the exact same package versions.</p><h2 id="why-this-works">Why This Works</h2><ul><li>Those commit hashes mean identical packages every time. No more &quot;it worked on my machine&quot;.</li><li>Docker can cache each package stage independently.</li><li>The packages are layered efficiently by Nixery</li><li>No Nix knowledge required: You just write normal <code>devbox.json</code> files. The script below handles the Nix complexity.</li></ul><h2 id="the-script">The Script</h2><p>I made a shell script that does all this automatically. It reads your <code>devbox.json</code> and <code>devbox.lock</code>, extracts the commit hashes, and generates the Dockerfile for you.</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://gist.github.com/andr-ec/26b167d5f8422b5cf78a98bb4ac8b7e6?ref=blog.lambdo.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">A shell script that generates a dockerfile from a devbox.json and devbox.lock using nixery.dev</div><div class="kg-bookmark-description">A shell script that generates a dockerfile from a devbox.json and devbox.lock using nixery.dev - devbox-generate-dockerfile.sh</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" alt="Reproducible Production Docker Builds with Devbox and Nixery"><span class="kg-bookmark-author">Gist</span><span class="kg-bookmark-publisher">262588213843476</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://github.githubassets.com/assets/gist-og-image-54fd7dc0713e.png" alt="Reproducible Production Docker Builds with Devbox and Nixery"></div></a></figure><p>The script is pretty straightforward and AI generated - it just parses the JSON files with <code>jq</code> and templates out the multi-stage Dockerfile. From there you modify it like any other Dockerfile. </p><h2 id="production-notes">Production Notes</h2><p>You&apos;d probably want to host your own Nixery instance instead of using the public <code>nixery.dev</code>. The concept is the same though.</p><p></p><p>This gives you the benefits of Nix&apos;s deterministic builds without having to learn Nix. Your Docker images are smaller, your builds are reproducible, and you don&apos;t have to deal with package drift anymore.</p><p>The current <code>docker generate</code> in Devbox works but isn&apos;t as optimal as this approach. This gets you closer to what <code>buildLayeredImage</code> does natively in Nix, just wrapped in a more familiar Docker workflow. </p><p></p><p></p><p>If you need help deploying, our team at Lambdo is ready to help.</p>]]></content:encoded></item><item><title><![CDATA[NixOS from personal to business]]></title><description><![CDATA[<p>If you&apos;re not familiar with NixOS the basic pitch is:</p><blockquote>Declarative builds and deployments.<br>if a package works on one machine, it will also work on another.<br>trivial to share development and build environments<br>installing or upgrading one package cannot break other packages</blockquote><p>I&apos;ve been running</p>]]></description><link>https://blog.lambdo.com/using-nixos-in-a-small-business/</link><guid isPermaLink="false">664e17cff8722d0001d109aa</guid><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Mon, 27 May 2024 19:54:10 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1714846201575-4f06e069dc6f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDF8fG5peG9zfGVufDB8fHx8MTcxNjM5Mzk0MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1714846201575-4f06e069dc6f?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=M3wxMTc3M3wwfDF8c2VhcmNofDF8fG5peG9zfGVufDB8fHx8MTcxNjM5Mzk0MHww&amp;ixlib=rb-4.0.3&amp;q=80&amp;w=2000" alt="NixOS from personal to business"><p>If you&apos;re not familiar with NixOS the basic pitch is:</p><blockquote>Declarative builds and deployments.<br>if a package works on one machine, it will also work on another.<br>trivial to share development and build environments<br>installing or upgrading one package cannot break other packages</blockquote><p>I&apos;ve been running NixOS on my personal machines and in local and cloud servers for almost a year now. I started playing around with it locally initially and eventually moved it to production uses. It definitely has a somewhat steep learning curve, but in my case it was enough to start with an example and build it up from there.</p><p>The official docs and package search is functional enough but leaves a bit to be desired in detail. But those are getting better. In my case these resources were indispensable:</p><p></p><figure class="kg-card kg-bookmark-card kg-card-hascaption"><a class="kg-bookmark-container" href="https://github.com/Misterio77/nix-starter-configs?ref=blog.lambdo.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">GitHub - Misterio77/nix-starter-configs: Simple and documented config templates to help you get started with NixOS + home-manager + flakes. All the boilerplate you need!</div><div class="kg-bookmark-description">Simple and documented config templates to help you get started with NixOS + home-manager + flakes. All the boilerplate you need! - Misterio77/nix-starter-configs</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.githubassets.com/assets/pinned-octocat-093da3e6fa40.svg" alt="NixOS from personal to business"><span class="kg-bookmark-author">GitHub</span><span class="kg-bookmark-publisher">Misterio77</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://opengraph.githubassets.com/503fe45e98601001112334b5c52a8ece74abc6b7f5c3ddaf1f5e48c11d121761/Misterio77/nix-starter-configs" alt="NixOS from personal to business"></div></a><figcaption><p><span style="white-space: pre-wrap;">A starter config, with reference to a real personal config</span></p></figcaption></figure><figure class="kg-card kg-bookmark-card kg-card-hascaption"><a class="kg-bookmark-container" href="https://www.youtube.com/@vimjoyer?ref=blog.lambdo.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Vimjoyer</div><div class="kg-bookmark-description">Teile deine Videos mit Freunden, Verwandten oder der ganzen Welt</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://www.youtube.com/s/desktop/751c6312/img/favicon_144x144.png" alt="NixOS from personal to business"><span class="kg-bookmark-author">YouTube</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://yt3.googleusercontent.com/xZGfl8scVBYJ-XQnC0-pUyrYIPuKf8FnPreem32Wpo4bw8wO0sA1rA0ZlZCtedTtl9so2ftycw=s900-c-k-c0x00ffffff-no-rj" alt="NixOS from personal to business"></div></a><figcaption><p><span style="white-space: pre-wrap;">Vimjoyer&apos;s youtube channel, he links to example repositories</span></p></figcaption></figure><figure class="kg-card kg-bookmark-card kg-card-hascaption"><a class="kg-bookmark-container" href="https://nix.dev/tutorials/first-steps/?ref=blog.lambdo.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">First steps &#x2014; nix.dev documentation</div><div class="kg-bookmark-description"></div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://nix.dev/_static/favicon.png" alt="NixOS from personal to business"><span class="kg-bookmark-author">nix.dev</span><span class="kg-bookmark-publisher">Nix documentation team</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://nix.dev/_static/img/nix.svg" alt="NixOS from personal to business"></div></a><figcaption><p><span style="white-space: pre-wrap;">nix language introduction</span></p></figcaption></figure><div class="kg-card kg-header-card kg-v2 kg-width-full kg-content-wide " style="background-color: #000000;" data-background-color="#000000">
            
            <div class="kg-header-card-content">
                
                <div class="kg-header-card-text kg-align-center">
                    <h2 id="learning-nixos-for-personal-use" class="kg-header-card-heading" style="color: #FFFFFF;" data-text-color="#FFFFFF"><span style="white-space: pre-wrap;">Learning NixOS for personal use</span></h2>
                    
                    
                </div>
            </div>
        </div><p>It&apos;s nice for personal use because tinkering with a linux setup, packages, desktop environment, os config is really low risk. It&apos;s easy to roll back to a previous version, and the whole system and user config (through home-manager) can be kept in a single git repository.</p><p>I&apos;ve been using NixOS personally on old laptops, handheld computers and raspberry pis. The first configuration was the hardest. It took some time but with the resources above and digging through the nixos forums I was able to get the first draft running on an old macbook air. </p><p>If anyone is serious about learning NixOS for personal use I really recommend installing it on an old computer that&apos;s sitting around or to boot it up on a virtual machine.</p><div class="kg-card kg-header-card kg-v2 kg-width-full kg-content-wide " style="background-color: #000000;" data-background-color="#000000">
            
            <div class="kg-header-card-content">
                
                <div class="kg-header-card-text kg-align-center">
                    <h2 id="applying-nixos-to-production-business-use" class="kg-header-card-heading" style="color: #FFFFFF;" data-text-color="#FFFFFF"><span style="white-space: pre-wrap;">Applying NixOS to production business use</span></h2>
                    
                    
                </div>
            </div>
        </div><p>Using NixOS in production so far has been a great experience for us overall. First off, a bit about my team to explain how we use it. We are a small team of developers that for the most part work on a contract and retainer basis and offer some software products. We build apps, services, integrations, and AI products for our clients. We specialize in rescue projects, meaning clients come from issues with previous tech or developers. We also manage hosting and cloud resources for our clients including NixOS servers. If any of the above is interesting feel free to <a href="https://www.lambdo.com/contact/?ref=blog.lambdo.com" rel="noreferrer">reach out</a> &#x1F642;</p><p>So we have multiple use cases for NixOS. We we use it to self host internal services, we use it to host our other product services, we use it to manage our clients services on their cloud providers, we use it in proxmox vms, we use it for development at the repository level through devbox. I cover the basics below, but I might cover the actual implementation of each use case in more detail in a future post.</p><p>In our case it was very easy to take my personal nixos config and and adapt it to a production server. Obviously there are differences between OS setup for a local device and a vm server but those differences aren&apos;t too much of a concern. For example one cloud provider that we use is Hetzner. They don&apos;t provide a NixOS image by default, but that&apos;s easy to overcome with <a href="https://github.com/elitak/nixos-infect?ref=blog.lambdo.com" rel="noreferrer">NixOS-Infect</a>. NixOS-Infect installs the operating system onto a vm in Hetzner and generates a configuration file. That configuration file is already valid and can be saved in a repository. Any settings and configuration from a personal config can be copied over, stored in the same repository, or can be shared by creating a nix module. </p><h2 id="hosting-our-services">Hosting our services</h2><p>This post you&apos;re reading is actually using the open source <a href="https://ghost.org/?ref=blog.lambdo.com" rel="noreferrer">Ghost Blog</a> on a NixOS server on Hetzner! Similarly, we host other open sources services that we use internally. Some services use docker images through <a href="https://search.nixos.org/options?channel=unstable&amp;show=virtualisation.oci-containers.containers.%3Cname%3E.workdir&amp;from=0&amp;size=50&amp;sort=relevance&amp;type=packages&amp;query=virtualisation.oci-containers&amp;ref=blog.lambdo.com" rel="noreferrer">nixos oci-containers</a>. Others are just nixos packages configured to run as systemd services. Some of our product services are also running on nixos. One of the big benefits for using nixos in production for us is that all of the configuration is very explicit and can be seen in the configuration repository. Meaning we won&apos;t forget if we make a configuration change to the server directly because it&apos;s will have to go through the repository first. It also makes moving projects between cloud providers easier.</p><h2 id="proxmox-nixos-vms">Proxmox NixOS VMs</h2><p><a href="https://github.com/features/codespaces?ref=blog.lambdo.com" rel="noreferrer">Github codespaces</a> seems like a great product to provide powerful machines to thin clients. We use nixos vms on proxmox as a self hosted alternative. Each vm can be configured for each user, the same configuration can be applied and deployed to all vms at once. We can even add <a href="https://github.com/coder/code-server?ref=blog.lambdo.com" rel="noreferrer">code server</a> to each vm so that they can be accessed from a browser!</p><p>This was actually our first usage of nixos in our business. It was not all that different from running on an actual device. The differences were actually in the specifics of using proxmox.</p><h2 id="devbox-for-each-repository">Devbox for each repository</h2><p>We also use <a href="https://www.jetify.com/devbox?ref=blog.lambdo.com" rel="noreferrer">Devbox</a> for each project that we are working on to create dev environments. Devbox actually uses nix under the hood. Devbox removes the need to manage versions of packages manually. For example we have used <a href="https://www.npmjs.com/package/n?ref=blog.lambdo.com" rel="noreferrer">n</a> and <a href="https://volta.sh/?ref=blog.lambdo.com" rel="noreferrer">volta</a> in the past to manage versions of node, that&apos;s not needed any more. We can manage versions of nodejs, yarn, and any other external dependency all through devbox. All developers have access to the exact same dev environment which removes most instances of &quot;it works on my machine&quot;. Similarly this devbox configuration can be used in production as well with a docker build or as a systemd service.</p><p>Devbox is a great introduction to getting the benefits of NixOS, without having to go through the steep learning curve.</p><hr><p>Overall using NixOS has been a great experience. It has made our production services more explicit and our local builds reproducible. I&apos;d recommend it to business or developers interested in declarative and reproducible builds. If you&apos;re interested and have any questions, feel free to reach out and I&apos;ll point you in the right direction.</p>]]></content:encoded></item><item><title><![CDATA[Semantic Parsing English to GraphQL]]></title><description><![CDATA[<p>For the last few months I&apos;ve been eagerly working on building a Natural Language Processing model. I present &#xA0;<strong>Semantic Parsing English-to-GraphQL </strong>(SPEGQL).</p><p>In this post, I&apos;ll cover some of the highlights, and include my presentation at OpenAI.</p><h3 id="background">Background</h3><p><strong>GraphQL</strong></p><p><a href="https://graphql.org/?ref=blog.lambdo.com">GraphQL</a> is a query language for</p>]]></description><link>https://blog.lambdo.com/spegql-openai-scholars-final-project/</link><guid isPermaLink="false">65e779ee9ca9490001f70a7f</guid><category><![CDATA[openai]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Thu, 02 Jul 2020 17:42:43 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1456428746267-a1756408f782?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1456428746267-a1756408f782?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="Semantic Parsing English to GraphQL"><p>For the last few months I&apos;ve been eagerly working on building a Natural Language Processing model. I present &#xA0;<strong>Semantic Parsing English-to-GraphQL </strong>(SPEGQL).</p><p>In this post, I&apos;ll cover some of the highlights, and include my presentation at OpenAI.</p><h3 id="background">Background</h3><p><strong>GraphQL</strong></p><p><a href="https://graphql.org/?ref=blog.lambdo.com">GraphQL</a> is a query language for your API.</p><p>Recently GraphQL has gained a lot of popularity. Some of the main benefits I&apos;ll note are: it represents the API&apos;s schema as a graph, nested relations of any depth can be easily queried, it can aggregate data over multiple datasources and responses are predictable among other things.</p><p><strong>Semantic Parsing</strong></p><p>Semantic parsing is the task of converting a natural language utterance to a logical form: a machine-understandable representation of its meaning. In this case I wanted to semantically parse from English, to GraphQL.<br></p><p>Why this project?</p><p>I had a few reasons to work on this project:</p><ul><li>I wanted to understand the limits of general language models for Semantic Parsing</li><li>This project could potentially ease the learning curve for new developers of GraphQL </li><li>It has potential use as tooling for non technical data users, such as managers, to gain insights into their data</li></ul><h2 id="objective">Objective</h2><p>Given an English prompt:</p><blockquote><em>&#x201C;What is the name and date of the song released most recently?&#x201D;</em></blockquote><p>And some GraphQL Schema</p><!--kg-card-begin: markdown--><pre><code>type song {
 artist: artist
 artist_name: String
 country: String
 f_id: Int
 file: files
 genre: genre
 genre_is: String
 languages: String
 rating: Int
 releasedate: String
 resolution: Int
 song_name: String
}

...
</code></pre>
<!--kg-card-end: markdown--><p>Find a corresponding GraphQL Query: </p><!--kg-card-begin: markdown--><pre><code>query {
 song(limit: 1, order_by: {releasedate: desc}) {
   song_name
   releasedate
 }
}
</code></pre>
<!--kg-card-end: markdown--><p>This objective could be tested by passing the prompt and schema though a model (In this case T5) to output a query. The process is as follows: </p><figure class="kg-card kg-image-card"><img src="https://blog.lambdo.com/content/images/2020/07/Screen-Shot-2020-07-02-at-12.13.09-PM.png" class="kg-image" alt="Semantic Parsing English to GraphQL" loading="lazy"></figure><h2 id="methods">Methods</h2><p>The process required multiple steps</p><ol><li>Create an English to GraphQL dataset</li><li>Run experiments on Encoder-Decoder Transformer models (Bart and T5)</li><li>Collect data and results</li><li>Implement a graphical interface to interact with the model</li></ol><h2 id="results">Results</h2><ul><li>46 - 50% exact set matching accuracy on GraphQL validation dataset</li></ul><p>A couple of example videos will help show results as well </p><figure class="kg-card kg-embed-card kg-card-hascaption"><iframe width="459" height="344" src="https://www.youtube.com/embed/OG8ZdSkF2BA?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><figcaption>A query is generated for a schema and question.</figcaption></figure><figure class="kg-card kg-embed-card kg-card-hascaption"><iframe width="459" height="344" src="https://www.youtube.com/embed/HE9Q52THeJY?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe><figcaption>The model is able to generalize to new, different schemas it was not trained on.&#xA0;</figcaption></figure><h2 id="other-notes">Other Notes</h2><p>Here is the main Repo for creating and validating the Dataset:</p><p><a href="https://github.com/acarrera94/sql-to-graphql?ref=blog.lambdo.com">https://github.com/acarrera94/sql-to-graphql</a></p><p>I also created an example notebook for anyone who wants to try out the model. This model is finetuned on GraphQL and SQL and can create queries for both languages:</p><p><a href="https://colab.research.google.com/drive/1l1h8RlEl-IS0XfkDh66qikH4UsD19KF6?usp=sharing&amp;ref=blog.lambdo.com"><a href="https://drive.google.com/uc?id=1H026ff-czIdLH3saJzbWUH8VKOW3j63X&amp;ref=blog.lambdo.com"><a href="https://colab.research.google.com/drive/1XdPrjtnr4e-O7imQEjDQ9XhCVaurR2Mf?usp=sharing&amp;ref=blog.lambdo.com"><a href="https://colab.research.google.com/drive/1XdPrjtnr4e-O7imQEjDQ9XhCVaurR2Mf?usp=sharing&amp;ref=blog.lambdo.com">https://colab.research.google.com/drive/1l1h8RlEl-IS0XfkDh66qikH4UsD19KF6?usp=sharing</a></a></a></a></p><p>I&apos;m currently working on a paper that details the whole process, that&apos;s linked <a href="https://docs.google.com/document/d/1EmAFC2LGxu8zG3LI6vMt8SrGpjwYtBpnDqCtj_AnDJQ/edit?usp=sharing&amp;ref=blog.lambdo.com">here</a>.</p><p>And finally, I also gave a presentation about my project at OpenAI: </p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://openai.com/blog/openai-scholars-spring-2020-final-projects/?ref=blog.lambdo.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">OpenAI Scholars Spring 2020: Final Projects</div><div class="kg-bookmark-description">Our third class of OpenAI Scholars [/blog/openai-scholars-spring-2020/] presented their final projects at virtual Demo Day, showcasing their researchresults from over the past five months. These projects investigated problemssuch as analyzing how GPT-2 represents grammar, measuring the interpreta&#x2026;</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://openai.com/favicon.png" alt="Semantic Parsing English to GraphQL"><span class="kg-bookmark-author">OpenAI</span><span class="kg-bookmark-publisher">OpenAI</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://openai.com/content/images/2020/07/openai-scholars-gradient-horizontal-stacked-2.png" alt="Semantic Parsing English to GraphQL"></div></a></figure><figure class="kg-card kg-embed-card"><iframe width="356" height="200" src="https://www.youtube.com/embed/liMJS5DrnlQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></figure>]]></content:encoded></item><item><title><![CDATA[Reflecting on the OpenAI Scholars Program]]></title><description><![CDATA[<p> The scholars program is coming to an end. Since my next post will detail my final project, I thought this would be a good opportunity to reflect on the scholars program as a whole. I&apos;d like to talk about the goals of the scholars program.</p><h2 id="goal-of-the-scholars-program">Goal of the</h2>]]></description><link>https://blog.lambdo.com/reflecting-on-the-openai-scholars-program/</link><guid isPermaLink="false">65e779ee9ca9490001f70a7e</guid><category><![CDATA[openai]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Thu, 02 Jul 2020 17:39:59 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1515700553106-bdf080dd3d25?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MXwxMTc3M3wwfDF8c2VhcmNofDE5fHxyZWZsZWN0aW9ufGVufDB8fHw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1515700553106-bdf080dd3d25?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MXwxMTc3M3wwfDF8c2VhcmNofDE5fHxyZWZsZWN0aW9ufGVufDB8fHw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Reflecting on the OpenAI Scholars Program"><p> The scholars program is coming to an end. Since my next post will detail my final project, I thought this would be a good opportunity to reflect on the scholars program as a whole. I&apos;d like to talk about the goals of the scholars program.</p><h2 id="goal-of-the-scholars-program">Goal of the Scholars Program</h2><p>The goal of the <a href="https://openai.com/blog/openai-scholars-spring-2020/?ref=blog.lambdo.com">Scholars program</a> is to improve diversity in the field at large. This was worked towards by providing stipends and mentorship to individuals from underrepresented groups to <strong>study deep learning and produce an open source project</strong>. </p><h2 id="self-motivation">Self Motivation</h2><p>Since the objective of a scholar in the program is to study deep learning and produce an open source project, a scholar should be very self motivated and technically proficient. Self motivation is important when developing your own curriculum/project as is done in this program. And the technical proficiency is a good signal that a scholar will be comfortable creating an open source project.</p><p>The program was set up in such a way that it was flexible for each scholar to learn/work at their own pace and work on their own domain/project. I personally found that flexibility awesome. I think of myself as very self motivated and I believe that, that was to my benefit during the program. I spent the first part of the program learning about the state of the art in natural language processing and contributing to open source. And I spent the last part of the program working on my final project. I think that to thrive in this program, you must be very self motivated and willing to learn. </p><p>In my opinion, this cohort of the scholars program is was very technically proficient. So I believe that any of the scholars in this cohort will be able to contribute to the field. Although our level of experience with respect to deep learning varied from little to none, the experience with the technical definitely helped everyone build a foundation for future deep learning work. </p><p>Assuming the scholars program continues to have similar expectations, for someone to be a successful scholar in the future, self motivation and a high level of technical proficiency will be essential. Anyone reading this article looking to apply for a future cohort of the Scholars Program (or a similar program) should consider those skills. Since this is only the third cohort, the scholars program might change in the future, so it&apos;s helpful to keep an eye out for the current requirements and expectations in the scholars program. Recently, OpenAI announced that the scholars program will have another cohort this fall. For more on that follow the <a href="https://openai.com/?ref=blog.lambdo.com">OpenAI blog</a>. </p><h2 id="diversity">Diversity</h2><p>Since the start of the program I have thought about that main goal to improve diversity in the field and what that means for me, and I have some thoughts to share. Although conversations about diversity are interesting, helpful, and necessary, unfortunately issues such as these are also very &quot;complex, sensitive, and nuanced&quot;. I believe that these conversations deserve to be talked about in depth, acknowledging the underlying assumptions and nuances, but I don&apos;t feel I can do the whole topic justice in a short blog post format. For that reason I&apos;ll try to keep it simple and as specific to this program (or deep learning) as possible. </p><p>The goal of diversity programs such as these are definitely noble, I would love to see more people from many backgrounds participate in deep learning specifically. I believe that diversity of thought/background is helpful in the creative process, specifically in divergent thinking. And in a field such as deep learning where there is much to be discovered, divergent thinking is a necessity. And it was awesome to me that the program itself was very flexible, allowing us with varied levels of experience to grow in deep learning. That&apos;s why overall, I think that the scholars program is a great way to introduce that, I applaud the effort and I believe we&apos;ll see great results from this cohort soon enough.</p><h2 id="gratitude">Gratitude</h2><p>I&apos;d like to give thanks to some communities and people that have been helpful throughout the </p><p>OpenAI: For the opportunity to be part of this program, connect with experts and setting up some future opportunities. </p><p>Huggingface, Pytorch Lightning: Very helpful in sharing resources and answering questions. </p><p>Melanie Subbiah: my mentor for the scholars program, always insightful and helpful. Good mentorship is rare but Melanie proved to be a wonderful mentor for me. </p><p>My wife Noelle for being a support throughout this journey!</p>]]></content:encoded></item><item><title><![CDATA[First Experiments]]></title><description><![CDATA[<p>My final project involves taking natural language English prompts and running them through a model to generate corresponding GraphQL queries. This post details the preliminary model experiments and validation strategies I&apos;ve used the past couple of weeks. </p><h2 id="original-plan">Original Plan</h2><p>As you can see in my <a href="https://docs.google.com/document/d/1B6pMNfaRjmKrBkowh9rdOpietAz9Ls3jbUKYFQkz-1U/edit?usp=sharing&amp;ref=blog.lambdo.com">project proposal document</a></p>]]></description><link>https://blog.lambdo.com/first-experiments/</link><guid isPermaLink="false">65e779ee9ca9490001f70a7d</guid><category><![CDATA[openai]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Wed, 27 May 2020 16:56:54 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1484589065579-248aad0d8b13?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1484589065579-248aad0d8b13?ixlib=rb-1.2.1&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;cs=tinysrgb&amp;w=2000&amp;fit=max&amp;ixid=eyJhcHBfaWQiOjExNzczfQ" alt="First Experiments"><p>My final project involves taking natural language English prompts and running them through a model to generate corresponding GraphQL queries. This post details the preliminary model experiments and validation strategies I&apos;ve used the past couple of weeks. </p><h2 id="original-plan">Original Plan</h2><p>As you can see in my <a href="https://docs.google.com/document/d/1B6pMNfaRjmKrBkowh9rdOpietAz9Ls3jbUKYFQkz-1U/edit?usp=sharing&amp;ref=blog.lambdo.com">project proposal document</a>, I planned to experiment with a few models including the BART, the vanilla transformer, and the Reformer. I&apos;ve stayed close to that original plan though I replaced the vanilla transformer with T5. The idea was to run some preliminary experiments with each of those models and see collect results that later on, I would be able to improve these metrics. </p><h2 id="roadblocks">Roadblocks</h2><p>I think it&apos;s helpful to reflect on some of the issues I found as I started training the models. There were some minor issues including errors with my dataset, hyperparameter issues, and computation constraints. But those roadblocks were easily fixed with a little debugging. The biggest issue I ran into that I didn&apos;t plan for was my evaluation metrics. </p><p>Initially, I just assumed I would be able to use the same evaluation metrics as Spider (the dataset my dataset was based on). Then while running through my models I realized I needed to do a little more research. Eventually I landed on the idea of taking the results from my model and my target queries and parsing them into an Abstract Syntax Tree. I could then use set comparison between the ASTs and get a boolean accuracy for each example. Luckily I found a <a href="https://github.com/graphql-python/graphql-core/blob/master/docs/usage/parser.rst?ref=blog.lambdo.com">library</a> to parse GraphQL queries into an AST. I had to make a few minor tweaks but eventually I had an accuracy validation metric I could run my models against. </p><h2 id="results">Results</h2><p>Once I validated my models on my validation accuracy, I was pretty excited with my results. I got 48% accuracy on my T5 model! It seemed like a big deal to me since this is a new dataset and a new task and I&apos;m already getting results without much hyperparameter turning. </p><h2 id="future-work">Future Work</h2><p>The validation metric that I came up with seems to work for my purposes but there could be improvements. Since queries are just trees based on the schema graph, there are multiple ways to represent equivalent queries. So ideally I could come up with a way to evaluate those queries equivalently, though I&apos;m not sure my time constraints will allow it. Other options include adding execution accuracy, to verify how queries run against my GraphQL endpoints.</p><p>In the coming weeks I&apos;ll continue to experiment with my models, collect further results and compile everything I&apos;ve gathered from the program!</p>]]></content:encoded></item><item><title><![CDATA[Building a Deep Learning Dataset]]></title><description><![CDATA[<p>My <a href="https://blog.lambdo.com/openai-project/">final project</a> for OpenAI is to generate GraphQL queries from natural english prompts. The first project deliverable is to create a GraphQL dataset. This post will detail the process I went through to create that dataset and my reflection of each step.</p><h2 id="research-plan">Research &amp; Plan</h2><p>I started doing some</p>]]></description><link>https://blog.lambdo.com/creating-a-dl-dataset/</link><guid isPermaLink="false">65e779ee9ca9490001f70a7c</guid><category><![CDATA[en]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Fri, 22 May 2020 17:22:45 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1558244661-d248897f7bc4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MXwxMTc3M3wwfDF8c2VhcmNofDYyfHxsZWdvc3xlbnwwfHx8&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1558244661-d248897f7bc4?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MXwxMTc3M3wwfDF8c2VhcmNofDYyfHxsZWdvc3xlbnwwfHx8&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Building a Deep Learning Dataset"><p>My <a href="https://blog.lambdo.com/openai-project/">final project</a> for OpenAI is to generate GraphQL queries from natural english prompts. The first project deliverable is to create a GraphQL dataset. This post will detail the process I went through to create that dataset and my reflection of each step.</p><h2 id="research-plan">Research &amp; Plan</h2><p>I started doing some preliminary research as I prepared my project proposal. This included researching different tools and resources that I could use to create a dataset. The tools I used are detailed in my <a href="https://docs.google.com/document/d/1B6pMNfaRjmKrBkowh9rdOpietAz9Ls3jbUKYFQkz-1U/edit?ref=blog.lambdo.com">project proposal</a>. It took a bit of balancing the available tools with the tools I&apos;m comfortable with. One of the most important resources I used was the Spider Dataset, a Text-to-SQL dataset. My idea was to build off that dataset and convert it to GraphQL. It took some research to even realize if it was even possible. I spent days looking at SQL and GraphQL grammar and I&apos;ve reviewed the dataset throughout. I took notes about possible approaches, went through different exercises until I felt comfortable with an approach. It took around 2 weeks of research and planning before I felt I had a solid approach and the right tools.</p><p>I felt that those 2 weeks were enough to have a solid foundation to build on, maybe a little more would have been helpful. Too much more time and I would have lost time running experiments. Any less and I might not have enough underlying understanding to build the dataset.</p><h2 id="coding-building">Coding &amp; Building</h2><p>Building the dataset took a decent amount of engineering. All in all it, I wrote 7 scripts and around 2,000 lines of code, plus some more generated code. Most of the process went pretty smoothly. &#xA0;I don&apos;t want to go into too much technical detail but there were some choices that ended up being instrumental in building the dataset. </p><p>One strategy I took was to use the language and IDE to offload cognitive load as much as possible, since I expected the engineering to get intense. I used Swift for its type system since I was dealing with structured data. It&apos;s also a language I&apos;m comfortable with, and it&apos;s speed and debugging tools were also beneficial. </p><p>I also found myself making a lot of assumptions about the dataset, so I would validate these assumptions by littering my scripts with assert statements and fatal errors. This had the secondary benefit that I gained a decent understanding of the examples in the dataset. </p><p>Surprisingly I only ran into a couple issues in the process, though these are decently technical and specific to my dataset. One of the big features of the Spider dataset was that it includes many complex queries, the issues I ran into were in these queries. For example, one issue was that Hasura (the tool that builds a GraphQL endpoint on top of a DB) &#xA0;has the limitation that its default endpoint <a href="https://github.com/hasura/graphql-engine/issues/2965?ref=blog.lambdo.com">can&apos;t represent</a> the <strong>GROUP BY </strong>clause. With issues like these I had to decide between writing manual queries or throwing out those examples.</p><p>I did expect to run into more issues while engineering but I was pretty happy with how smooth it went and how the dataset turned out. This ended up taking around 3 weeks before the dataset was at a point where I could start validating it and running some deep learning experiments with it. </p><h2 id="review-validation">Review &amp; Validation</h2><p>This step had me going back to the dataset and fixing issues that I found after the fact. This process included manually looking at examples and verifying the queries syntax and ran on Hasura. There were some issues I only ran into while running the dataset through a baseline network. Luckily I found most issues by writing a script to validate the queries with an <a href="https://github.com/apollographql/eslint-plugin-graphql?ref=blog.lambdo.com">eslint plugin</a>.</p><p>Although this step has added more work than I expected, I learned the obvious lesson that review and validation is necessary to build a high quality dataset.</p><h2 id="next-steps">Next Steps</h2><p>I&apos;m actually not finished with reviewing my dataset. I&apos;m still catching and fixing minor issues. But I&apos;ll be constantly improving and adding examples until the end of the project. </p><p>At the end of the project I&apos;ll be releasing the dataset along with all of the source code. For now I&apos;ll be working on building those baseline models and improving the dataset. </p>]]></content:encoded></item><item><title><![CDATA[Text-to-GraphQL, OpenAI Project Proposal]]></title><description><![CDATA[<p>The OpenAI scholars program ends with the deliverable of an open source final project. I&apos;ll be working on this project from now until the start of July when the program ends. This post will give a brief overview and a link to my proposal for that project. </p><h2 id="text-to-graphql">Text-to-GraphQL</h2>]]></description><link>https://blog.lambdo.com/openai-project/</link><guid isPermaLink="false">65e779ee9ca9490001f70a7b</guid><category><![CDATA[openai]]></category><category><![CDATA[en]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Mon, 20 Apr 2020 20:02:59 GMT</pubDate><media:content url="https://blog.lambdo.com/content/images/2020/04/GraphQL_Logo.svg-2.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.lambdo.com/content/images/2020/04/GraphQL_Logo.svg-2.png" alt="Text-to-GraphQL, OpenAI Project Proposal"><p>The OpenAI scholars program ends with the deliverable of an open source final project. I&apos;ll be working on this project from now until the start of July when the program ends. This post will give a brief overview and a link to my proposal for that project. </p><h2 id="text-to-graphql">Text-to-GraphQL</h2><p>The core goal of this project is simple. Given a natural english question and a GraphQL schema, give an equivalent GraphQL query. This means that the question and the schema will pass through a model, and that model will return a query that represents the question correctly. </p><p>For example the question:</p><blockquote>How many players do we have? </blockquote><p>Will return the following query: </p><!--kg-card-begin: markdown--><pre><code class="language-graphql">query {
  players_aggregate {
    aggregate {
      count
    }
  }
}
</code></pre>
<!--kg-card-end: markdown--><p>The query could be sent to the GraphQL endpoint and return a valid result.</p><p>There are a few deliverables leading up to, and following this main objective. </p><p>Mainly:</p><p><strong>Dataset creation </strong>(building a GraphQL dataset based on the <a href="https://yale-lily.github.io/spider?ref=blog.lambdo.com">Spider SQL dataset</a>)</p><p><strong>Training Multiple models</strong> (BART, Transformer, T5, Reformer)</p><p><strong>Interaction tool</strong> (input questions into a GUI)</p><p><strong>Submitting a Paper</strong> (including info on my dataset and and results from models)</p><p>The full proposal is found here: </p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://docs.google.com/document/d/1B6pMNfaRjmKrBkowh9rdOpietAz9Ls3jbUKYFQkz-1U/edit?usp=sharing&amp;ref=blog.lambdo.com"><div class="kg-bookmark-content"><div class="kg-bookmark-title">OpenAI final project proposal</div><div class="kg-bookmark-description">Text-to-GraphQL Andre Carrera April 6, 2020 Description Over the last several years, there has been a lot of headway made on text-to-SQL tasks through the introduction of new datasets and challenges. The problem presented is, given a natural english question and a database schema, produce a SQL q...</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://ssl.gstatic.com/docs/documents/images/kix-favicon7.ico" alt="Text-to-GraphQL, OpenAI Project Proposal"><span class="kg-bookmark-author">Google Docs</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://lh3.googleusercontent.com/xc0QFxUtwtdIGJ1Kc94cRYwJ0_s304VzWmVnZq1rhsSPg69uyBcmHcdfEZKvW2o5s6OO3Lx1DA=w1200-h630-p" alt="Text-to-GraphQL, OpenAI Project Proposal"></div></a></figure><p>I&apos;d <strong>love</strong> to hear feedback! Please reach out to me on twitter @<a href="https://mobile.twitter.com/AndreCarreraPaz?ref=blog.lambdo.com">AndreCarreraPaz</a></p><hr><h2 id="motivations">Motivations</h2><p>So why this project? </p><p>The main reasons I&apos;ll explain below are that:</p><ol><li>This is an intersection of my interests. NLP, GraphQL. Deep learning and Engineering. </li><li>I think this will be a useful contribution to the community. </li></ol><p>NLP is a field that has advanced significantly in the last few years. With <a href="https://openai.com/blog/better-language-models/?ref=blog.lambdo.com">GPT-2</a> for example, we can now see a network generate text based off of any prompt. It&apos;s fun to <a href="https://talktotransformer.com/?ref=blog.lambdo.com">play with</a>, and there&apos;s even <a href="https://aidungeon.io/?ref=blog.lambdo.com">games</a> that have come from it. <a href="https://www.blog.google/products/search/search-language-understanding-bert/?ref=blog.lambdo.com">BERT</a>, is another NLP tool that can help with things such Text Classification and Categorization and even question answering. </p><p>GraphQL is an amazing developer tool. It&apos;s a query language for your API. That means that you can have a typed schema on top of any API with any set of business logic and databases underneath. It&apos;s nice that data is returned in a hierarchy and the tooling that has come with it is incredible. For example, there is GUI schema exploration with <a href="https://github.com/graphql/graphiql?ref=blog.lambdo.com">GraphiQL</a>. And The <a href="https://www.apollographql.com/docs/ios/?ref=blog.lambdo.com">Apollo libraries</a> can generate typed code for your frontends. </p><p>Also, I like the idea of combining expert systems with deep learning models to get the best of both worlds. Broadly, this means that can use an unstructured question to get results from structured data. This combined with the ease of learning GraphQL makes for an interesting project. And hopefully with the release of dataset and code accompanying this project, future work will improve upon my results. </p><p>Stay tuned, the following blog posts will cover progress on my final project. </p>]]></content:encoded></item><item><title><![CDATA[DL vs Engineering - OpenAI weeks 7&8]]></title><description><![CDATA[<p>These last couple of weeks have involved a lot of code, from my <a href="https://github.com/huggingface/transformers/pull/3236?ref=blog.lambdo.com">PR to huggingface</a> to my <a href="https://github.com/tensorflow/swift-models/pull/422?ref=blog.lambdo.com">PR to Swift for Tensorflow</a>, to my current work on implementing &#xA0;a text-to-SQL model on the <a href="https://yale-lily.github.io/spider?ref=blog.lambdo.com">Spider dataset</a>. Since that time was spent mostly coding, I feel like I have picked</p>]]></description><link>https://blog.lambdo.com/vs-engineering-openai-weeks-7-8/</link><guid isPermaLink="false">65e779ee9ca9490001f70a7a</guid><category><![CDATA[openai]]></category><category><![CDATA[en]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Mon, 30 Mar 2020 22:48:14 GMT</pubDate><media:content url="https://blog.lambdo.com/content/images/2020/04/Group-1--1-.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.lambdo.com/content/images/2020/04/Group-1--1-.png" alt="DL vs Engineering - OpenAI weeks 7&amp;8"><p>These last couple of weeks have involved a lot of code, from my <a href="https://github.com/huggingface/transformers/pull/3236?ref=blog.lambdo.com">PR to huggingface</a> to my <a href="https://github.com/tensorflow/swift-models/pull/422?ref=blog.lambdo.com">PR to Swift for Tensorflow</a>, to my current work on implementing &#xA0;a text-to-SQL model on the <a href="https://yale-lily.github.io/spider?ref=blog.lambdo.com">Spider dataset</a>. Since that time was spent mostly coding, I feel like I have picked up on a few differences between deep learning and engineering.</p><p>As I&apos;ve mentioned in previous posts, I come from a software engineering background. I&apos;ve deployed client projects in Vue.js, Scala, SwiftUI, Kotlin, and Node.js. What that means is that I have a decent amount of experience in both frontend and backend development. I realized that deep learning definitely has a different feel and workflow than fullstack development. What follows are some of the differences I&apos;ve noticed as a novice in deep learning.</p><h2 id="feedback">Feedback</h2><p>The feedback loop is the biggest difference I&apos;ve notice between DL and engineering. The time spent between writing code and seeing the results can vary dramatically. </p><p>For example when I&apos;m writing code to load the dataset, or prepare a dataset, it&apos;s very comparable to writing backend code. In both cases I have data I want to take data from one place, process it, and return it to another place. Verifying that code can be pretty straight forward, just run some data through it. It&apos;s even possible to write test cases for the dataset. &#xA0;</p><p>Even the first steps of creating a model are similar to engineering. An architecture / design pattern is chosen and you can move forward implementing and connecting the pieces. If you run into an error at run time, it&apos;s not incredibly hard to debug, since you usually know where to look based off of a stack trace. </p><p>Where it gets rough is when you start training the model on the data. This is not comparable to any other type of programming I&apos;ve experience before. Your model could output NaNs, after a while of training and it takes some time to understand where that came from, your model could output a negative loss (you probably want positive) and you don&apos;t know what&apos;s causing it. Maybe your model doesn&apos;t learn; where do you even start to debug that? Finding these sorts of issues, at least for me, are very time consuming and it seems like it can only be solved through a lot of trial and error.</p><p>Then, the feedback loop can get really long. At this point, it&apos;s a matter of waiting for the model to train and checking the results. This process can take hours depending on the kind of data and the dataset. The unfortunate part is that this part is necessary to test different hyperparameters to get the best results. </p><p>Though it might seem like a frustrating process, it can be very rewarding. And that&apos;s a perfect segway in the next section, rewards. &#xA0;</p><h2 id="rewards">Rewards</h2><p>In engineering the feedback loop can be pretty short, especially in front end development. For example using something like Vue.js, React, or SwiftUI, means that as I&apos;m writing the code for some view, I can see that same view updated in real time on the same screen. This sort of work is immediately satisfying since you can <strong>constantly</strong> see exactly what you&apos;re making. That feedback loop is longer in backend development, since it can take time to see results and therefore more time to feel satisfied with a feature. Then in DL, that feedback loop can be stretched even further. </p><p>This doesn&apos;t mean that DL is any less satisfying. On the contrary, it can be more satisfying. Just with more varied time between results. </p><p>For example, a couple of weeks ago, I was working on training a model for a summarization task. It took me more than a week to get it working, I ran into the issues I described in the previous section. And at times it got a little frustrating. Then, I finally got some results. I summarized <a href="http://www.cnn.com/2007/US/07/13/btsc.obrien.criminallyinsane/index.html?ref=blog.lambdo.com">a CNN article</a> and got the following results: </p><blockquote>CNN&apos;s Soledad O&apos;Brien takes a tour of the &quot;forgotten floor,&quot; where mentally ill inmates are housed in Miami before trial. An inmate housed on the &quot;forgotten floor.</blockquote><p>I was ecstatic to see these results. These word combinations didn&apos;t appear together anywhere in the article, but the model was able to create this text which summarized the article and (somewhat) maintained the grammar. </p><p>This last week I was working on the text-to-SQL task. Where given a SQL schema and an english question, such as: &quot;<strong>How many singers do we have?</strong>&quot;. Output an equivalent SQL query. After some experimentation, I got the following: </p><blockquote>SELECT count(*) FROM singer GROUP BY singer_id</blockquote><p>This is a valid SQL query. The model learned SQL grammar and learned to translate english to a SQL query. These are the kinds of results that get me excited about deep learning. Though this process was very time consuming, and there was frustration involved, I felt very satisfied with the results. </p><hr><p>I&apos;ve been getting very excited about my final project. In my next blog post I will describe my final project and share my project proposal. </p>]]></content:encoded></item><item><title><![CDATA[Contribution - OpenAI weeks 5&6]]></title><description><![CDATA[<p>These past couple of week I&apos;ve been working on a contribution to the &#x1F917;<a href="https://huggingface.co/?ref=blog.lambdo.com">Huggingface</a> Transformers repo. Transformers is a fast moving library that uses the transformer deep learning architecture to solve problems such as translation, named entity recognition, summarization, and other nlp tasks. I also used the</p>]]></description><link>https://blog.lambdo.com/contribution-openai-weeks-3-4/</link><guid isPermaLink="false">65e779ee9ca9490001f70a79</guid><category><![CDATA[deeplearning]]></category><category><![CDATA[openai]]></category><category><![CDATA[en]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Wed, 18 Mar 2020 17:00:58 GMT</pubDate><media:content url="https://blog.lambdo.com/content/images/2020/04/d3a58b17-be73-472f-8e82-5b1f94c3e2c5.png" medium="image"/><content:encoded><![CDATA[<img src="https://blog.lambdo.com/content/images/2020/04/d3a58b17-be73-472f-8e82-5b1f94c3e2c5.png" alt="Contribution - OpenAI weeks 5&amp;6"><p>These past couple of week I&apos;ve been working on a contribution to the &#x1F917;<a href="https://huggingface.co/?ref=blog.lambdo.com">Huggingface</a> Transformers repo. Transformers is a fast moving library that uses the transformer deep learning architecture to solve problems such as translation, named entity recognition, summarization, and other nlp tasks. I also used the <a href="https://github.com/PyTorchLightning/pytorch-lightning?ref=blog.lambdo.com">PyTorch Lightning</a> framework. Lightning is a framework used to simplify and organize training and inference code. </p><p>This blog post is going to cover my experience building a system and turning that into a contribution to Transformers.</p><h3 id="open-source-contribution">Open Source Contribution</h3><p>My goal was to use the <a href="https://huggingface.co/transformers/model_doc/bart.html?ref=blog.lambdo.com#">BART model</a> for summarization. I did have access to a pre-trained model but I wanted to go through the process of training and evaluating it on the full dataset. The basic idea is that given some text article, output a short summary of the article. </p><p>There were several issues I ran into along the way. Debugging these sorts of issues while learning a library was really time consuming. I spent hours on simple problems where the solution was only 1 line of code. Understanding the library was very important, I wasn&apos;t afraid to dive into the source code, and step through simple examples. Then, once I finally got results with smaller examples I started experimenting with the hyper parameters. I knew that the intuition behind hyper parameters is a <em>trick of the trade. </em>And that&apos;s a little frustrating coming from an engineering background. Like I&apos;ve heard before, it is more of an art than a science. My solution was to run many experiments and see what happens, unfortunately I haven&apos;t heard many better alternatives.</p><p>After days of tinkering, I got results I was pretty happy with. </p><p>Given <a href="https://www.cnn.com/2007/US/07/13/btsc.obrien.criminallyinsane/index.html?ref=blog.lambdo.com">a CNN article</a> the model generated the following summary:</p><blockquote><em>CNN&apos;s Soledad O&apos;Brien takes a tour of the &quot;forgotten floor,&quot; where mentally ill inmates are housed in Miami before trial. An inmate housed on the &quot;forgotten floor.</em></blockquote><p>Pretty cool huh? </p><p>So why did I decide to spend some of my time contributing to an open source project? </p><p>The first motivation was that about a year ago, I talked to the owner of a local AI company. He said that applicants stand out when they&apos;ve contributed to deep learning projects. It shows self motivation, and that you can learn and contribute to an existing codebase. </p><p>The second motivation was, &quot;Why not?&quot;. I actually didn&apos;t start my project by thinking of how I could contribute to Huggingface. &#xA0;I started it with a desire to understand how to train a language model for summarization. Then once I realized I built something that wasn&apos;t available to other people, I cleaned up the code and turned it into a pull request.</p><p>The rest of the pull request was pretty straight forward, I just had to make some small requested changes, and it ended up being a very constructive experience. Although this contribution did take time and I struggled through it at times, I came out with a deeper understanding of the Transformers and PyTorch APIs. I also got invited to some slack channels to discuss this implementation, it turned out to be a great way to build on that community I talked about in my <a href="https://blog.lambdo.com/openai-weeks-3-4/">previous post</a>. </p><hr><p>In my next post I&apos;ll be talking about the differences I&apos;ve noticed between deep learning and engineering. </p>]]></content:encoded></item><item><title><![CDATA[Hacking away - OpenAI weeks 3&4]]></title><description><![CDATA[<p>While writing this blog post I realized that since the field of deep learning moves so fast, having too many technical details won&apos;t be useful as time goes on. So I&#x2019;ll try to focus more on sharing the details of my <strong>learning</strong> <strong>process </strong>and the lessons</p>]]></description><link>https://blog.lambdo.com/openai-weeks-3-4/</link><guid isPermaLink="false">65e779ee9ca9490001f70a78</guid><category><![CDATA[openai]]></category><category><![CDATA[en]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Sat, 29 Feb 2020 07:59:43 GMT</pubDate><media:content url="https://images.unsplash.com/photo-1508614999368-9260051292e5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MXwxMTc3M3wwfDF8c2VhcmNofDZ8fGdyYWRpZW50fGVufDB8fHw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" medium="image"/><content:encoded><![CDATA[<img src="https://images.unsplash.com/photo-1508614999368-9260051292e5?crop=entropy&amp;cs=tinysrgb&amp;fit=max&amp;fm=jpg&amp;ixid=MXwxMTc3M3wwfDF8c2VhcmNofDZ8fGdyYWRpZW50fGVufDB8fHw&amp;ixlib=rb-1.2.1&amp;q=80&amp;w=2000" alt="Hacking away - OpenAI weeks 3&amp;4"><p>While writing this blog post I realized that since the field of deep learning moves so fast, having too many technical details won&apos;t be useful as time goes on. So I&#x2019;ll try to focus more on sharing the details of my <strong>learning</strong> <strong>process </strong>and the lessons I&apos;ve learned.</p><h2 id="lessons-learned">Lessons learned </h2><p><strong>First big lesson, <em>community is invaluable</em>. </strong></p><p>These past two weeks I have been learning about language models. Many times I found myself with questions and a fuzzy<em> </em>understanding of how things worked. So I would reach out to my mentor, Melanie, and ask questions. I found it really helpful to talk through my confusion and explain those concepts to her and get feedback. I also spent time implementing a <a href="https://stanfordnlp.github.io/coqa/?ref=blog.lambdo.com">CoQA leaderboard</a> paper with another scholar, <a href="https://manlikemishap.github.io/year-archive/?ref=blog.lambdo.com">Pamela</a>. That pair programming helped me see different approaches to problem solving. And since I&apos;m remote, I&apos;ve been reviewing language model topics with local colleagues. &#xA0;All of these conversations were essential to building an intuition and a working understanding.</p><p>I also spent time going over a <a href="https://medium.com/huggingface/how-to-build-a-state-of-the-art-conversational-ai-with-transfer-learning-2d818ac26313?ref=blog.lambdo.com">huggingface tutorial</a>, and ending up contributing to the <a href="https://github.com/huggingface/transfer-learning-conv-ai?ref=blog.lambdo.com">repo</a>. The goal of the tutorial was to build a conversational bot using transfer learning for transformer models. Since my final project will be closely tied with transformers, I thought it would be helpful to dive into the code. While I was exploring the code and attempting to fine tune the model, I noticed that the repo was using an old version the library and I tried to update. The update wasn&apos;t trivial and I ended up submitting a pull request. I found it really valuable to interact with maintainers and it was satisfying to contribute something as a newcomer. </p><p>And finally I have also been attending the <a href="https://www.tensorflow.org/swift?ref=blog.lambdo.com">Swift for Tensorflow</a> design meetings. It&apos;s exciting to be part of a community building a tool that I believe in. And it&apos;s very helpful to see what goes into building a tool for deep learning. I&apos;m hoping to contribute more in the following weeks.</p><p><strong>Second big lesson, <em>tooling is invaluable</em>. </strong></p><p>At first I started doing everything on Google Colab notebooks. The hardware that comes with colab is decently performant and I thought it would be a good way to start and get quick feedback. One problem I had was that I found myself running into a lot of errors, and I instinctively started printing out shapes and tensors to get an idea of what was going on. Eventually I realized how much that process was slowing me down and I downloaded my code and ran it on an IDE with debugging enabled. The IDE was helpful in understanding the flow and architecture of the programs. There are benefits to both tools so I found myself switching between the tools depending on task. I think it&apos;s always valuable to know what tools are available and their limitations.</p><p><strong>Last big lesson, <em>direction is invaluable</em> </strong></p><p>I have found that having a direction to work towards, a goal or a vision, is the most important part of staying motivated. This isn&apos;t something specific to deep learning and isn&apos;t something I learned these last couple of weeks. But I&apos;ve always found it helpful in staying motivated in any big endevor, and the Scholars Program isn&apos;t any different. The vision I&apos;ve been working towards, in this case, is my final project. I started writing out a draft for my final project as soon as I knew I was accepted to the program. Since then, all of my work has been building towards that final project, and it has kept me motivated. </p><hr><p>Next time I&apos;ll be converging even more on resources that will help with my final project. And I&apos;m excited to get more experience under my belt! </p>]]></content:encoded></item><item><title><![CDATA[Introduction OpenAI weeks 1&2]]></title><description><![CDATA[<h2 id="introduction">Introduction</h2><p>My name is Andre Carrera, I am the founder of Lambdo.</p><p>For the next 4 months (February - May 2020) I&apos;ll be part of the 3rd cohort of the <a href="https://openai.com/blog/openai-scholars-spring-2020/?ref=blog.lambdo.com">OpenAI Scholars program</a>. I ran into this program by <em>coincidence </em>last year. I took <a href="https://cs.byu.edu/faculty/dw87?ref=blog.lambdo.com">Dr. Wingate&apos;s</a></p>]]></description><link>https://blog.lambdo.com/introduction-openai/</link><guid isPermaLink="false">65e779ee9ca9490001f70a77</guid><category><![CDATA[openai]]></category><category><![CDATA[deeplearning]]></category><category><![CDATA[OpenAI scholars]]></category><category><![CDATA[en]]></category><dc:creator><![CDATA[Andre Carrera]]></dc:creator><pubDate>Wed, 05 Feb 2020 02:07:35 GMT</pubDate><media:content url="https://blog.lambdo.com/content/images/2020/11/openai-logo-vertical-dimensional-purple-e1588267015132.png" medium="image"/><content:encoded><![CDATA[<h2 id="introduction">Introduction</h2><img src="https://blog.lambdo.com/content/images/2020/11/openai-logo-vertical-dimensional-purple-e1588267015132.png" alt="Introduction OpenAI weeks 1&amp;2"><p>My name is Andre Carrera, I am the founder of Lambdo.</p><p>For the next 4 months (February - May 2020) I&apos;ll be part of the 3rd cohort of the <a href="https://openai.com/blog/openai-scholars-spring-2020/?ref=blog.lambdo.com">OpenAI Scholars program</a>. I ran into this program by <em>coincidence </em>last year. I took <a href="https://cs.byu.edu/faculty/dw87?ref=blog.lambdo.com">Dr. Wingate&apos;s</a> deep learning class my last semester at BYU, and I as I was exploring opportunities in the field, I ran into a blog post for the program. I quickly applied, got through some interviews and here I am.</p><p>Every two weeks I will write about my experience. I&apos;ll try to be as detailed as possible and hopefully these blog posts will be useful for anyone interested in getting into the field. </p><p><strong>Self-Education</strong></p><p>I really believe self-education is a legitimate option for anyone interested in Deep Learning, or in development in general. Shorty after starting my university experience in CS, I realized that I wasn&apos;t going to be taught skills that would be applicable in the real world. It might just have been my university, but I felt that there was too much theory, too much busy work and not enough application. I only found a few of classes to be useful thus far, and I could fit all of those into a semester. </p><p>So, I took measures into my own hands and challenged myself to learn those skills. I did that by taking on software development projects. I took on projects not knowing how to use the technology but being fully confident that I would be able to learn. Lucky for me, that turned out to be the case. I found that having real projects with real goals and real outcomes was extremely helpful for my education. Not only was it good motivation to learn, but I was also learning real marketable skills. </p><p>I see the OpenAI scholars program as another opportunity to learn valuable skills. I&apos;m lucky enough to create my own curriculum and work on my own open source project. I&apos;m especially excited about the opportunity to rub shoulders with experts in the field. As part of the program I created a syllabus that I&apos;ll update throughout the program attached below. &#xA0;</p><p><a href="https://docs.google.com/document/d/1W4FvFZEuHXqaGUNA_BEb9OVxfDoA6M5UQQ6xxZRhx5k/edit?usp=sharing&amp;ref=blog.lambdo.com"><strong>Syllabus</strong></a></p><h2 id="exploration">Exploration</h2><p>I decided to use the first two weeks to explore, find interesting papers, learn some of the foundations and get a feel for how fast to approach things. I started out by going through Ian Goodfellow&apos;s <a href="https://www.deeplearningbook.org/?ref=blog.lambdo.com">Deep Learning Book</a> and reading some papers on my syllabus. After a day of that I realized I couldn&apos;t passively take in so much information. I&apos;m used to engineering where there is an objective and any reading and learning is quickly applied. So I decided to change my strategy a bit. I&apos;m going spread out the hard technical reading, and focus on more application and implementation.</p><p>I spent the week building an understanding of self attention and transformers, since the next few weeks and my final project will depend on that understanding. For anyone one interested in those topics <a href="http://jalammar.github.io/illustrated-transformer/?ref=blog.lambdo.com">The Illustrated Transformer</a> was extremely valuable. </p><p>I also decided that throughout the project I&apos;m going to contribute to <a href="https://www.tensorflow.org/swift?ref=blog.lambdo.com">Swift for Tensorflow</a>. In fact this week I started working on a pull request to implement an example transformer for translation, it&apos;ll be based on <a href="https://nlp.seas.harvard.edu/2018/04/03/attention.html?ref=blog.lambdo.com">the annotated transformer</a>. I&apos;ll be posting links once it&apos;s done. </p><hr><p>Next week I plan to work <a href="https://medium.com/huggingface/how-to-build-a-state-of-the-art-conversational-ai-with-transfer-learning-2d818ac26313?ref=blog.lambdo.com">Conversational AI with Transfer Learning</a>. I&apos;m interested to see what kind of result I can get with transformers and what other baselines I can implement. </p><p>If you have any questions, please feel free to reach out to me!</p><p><a href="https://www.linkedin.com/in/andre-carrera-86a567139/?ref=blog.lambdo.com">Andre Carrera</a></p>]]></content:encoded></item></channel></rss>