<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jonathan Stray</title>
	<atom:link href="http://jonathanstray.com/feed" rel="self" type="application/rss+xml" />
	<link>http://jonathanstray.com</link>
	<description>Information, culture, and belief</description>
	<lastBuildDate>Sun, 09 Feb 2025 11:46:22 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>To apply AI for good, think form extraction</title>
		<link>http://jonathanstray.com/to-apply-ai-for-good-think-form-extraction</link>
					<comments>http://jonathanstray.com/to-apply-ai-for-good-think-form-extraction#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Sat, 24 Oct 2020 22:51:35 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4563</guid>

					<description><![CDATA[Folks who want to use AI/ML for good generally think of things like building predictive models, but smart methods for extracting data from forms would do more for journalism, climate science, medicine, democracy etc. than almost any other application. Since March, I&#8217;ve been working with a small team on applying deep learning to a gnarly &#8230; <a href="http://jonathanstray.com/to-apply-ai-for-good-think-form-extraction" class="more-link">Continue reading <span class="screen-reader-text">To apply AI for good, think form extraction</span></a>]]></description>
										<content:encoded><![CDATA[
<p>Folks who want to use AI/ML for good generally think of things like building predictive models, but smart methods for extracting data from forms would do more for journalism, climate science, medicine, democracy etc. than almost any other application. Since March, I&#8217;ve been working with a small team on applying deep learning to a <a href="http://jonathanstray.com/extracting-campaign-finance-data-from-gnarly-pdfs-using-deep-learning">gnarly campaign finance dataset</a> that journalists have been struggling with for years. Today we are announcing <a href="https://wandb.ai/stacey/deepform_v1/reports/DeepForm-Understand-Structured-Documents-at-Scale--VmlldzoyODQ3Njg">Deepform</a>, a baseline ML model, training data set, and <a href="https://wandb.ai/deepform/political-ad-extraction/benchmark">public benchmark</a> where anyone can submit their solution. I think this type of technology is important, not just for campaign finance reporters but for everyone.</p>



<p>This post has four parts:</p>



<ul class="wp-block-list"><li>Why form extraction is an important problem </li><li>Why it&#8217;s hard</li><li>The start of the art of deep learning for form extraction </li><li>The <a href="https://wandb.ai/stacey/deepform_v1/reports/DeepForm-Understand-Structured-Documents-at-Scale--VmlldzoyODQ3Njg">Deepform</a> model and dataset, our contribution to this problem</li></ul>



<h3 class="wp-block-heading">Form extraction is incredibly useful</h3>



<p>Form extraction could help climate science because a lot of old weather data is locked in forms. These forms come in a crazy variety of different formats from all over the world and across centuries.</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><a href="https://twitter.com/ed_hawkins/status/1167769410238595072"><img fetchpriority="high" decoding="async" src="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.52.19-PM-908x1024.png" alt="" class="wp-image-4590" width="437" height="493" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.52.19-PM-908x1024.png 908w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.52.19-PM-266x300.png 266w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.52.19-PM-768x867.png 768w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.52.19-PM.png 1122w" sizes="(max-width: 437px) 100vw, 437px" /></a></figure></div>



<span id="more-4563"></span>



<p>Form extraction is useful for human rights work as well. In 2005, the <a href="https://www.nationalgeographic.com/photography/proof/2017/07/archive-of-the-national-police-guatemala/">National Police Historical Archive</a> was discovered in Guatemala, opening up a window to government crimes committed during the 35 year-long civil war. Over 100,000 people were abducted, tortured, or murdered, and in many cases these fragile paper documents are the only record of what happened to someone. They are largely hand-written and come in a wide variety of formats dating back to 1870, some <a href="https://ahpn.lib.utexas.edu/about_ahpn">80 million pages</a> in all. </p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img decoding="async" src="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-21-at-11.23.14-PM-793x1024.png" alt="" class="wp-image-4569" width="315" height="406" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-21-at-11.23.14-PM-793x1024.png 793w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-21-at-11.23.14-PM-232x300.png 232w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-21-at-11.23.14-PM-768x992.png 768w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-21-at-11.23.14-PM.png 900w" sizes="(max-width: 315px) 100vw, 315px" /><figcaption>A single page from the Guatemalan National Police Archive, one of 80 million (<a href="https://ahpn.lib.utexas.edu/search/documento/1601154?n=GE&amp;d=undated#page/1/mode/1up">source</a>).</figcaption></figure></div>



<p>Form extraction comes up in medicine too, even for present-day documents. UCSF Hospital processes 500 <em>faxed</em> referrals <a href="https://www.centerfordigitalhealthinnovation.org/patient-access-referrals-automation">each day</a>, requiring 57 full time staff to type them in.  These forms, such as the image below, can look like just about anything. The process has <a href="https://twitter.com/anobelodisho/status/1314679215719997440">recently</a> been partially automated.</p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img decoding="async" src="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.42.10-PM-825x1024.png" alt="" class="wp-image-4586" width="461" height="571" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.42.10-PM-825x1024.png 825w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.42.10-PM-242x300.png 242w" sizes="(max-width: 461px) 100vw, 461px" /><figcaption>An example referral form. If only they were standardized! (<a href="http://www.orlandosleep.com/referral-form.htm">source</a>)</figcaption></figure></div>



<p>There are plenty of gnarly forms in journalism too. Getting data out of forms can take months on a major investigative journalism project, like the recent <a href="https://www.icij.org/investigations/fincen-files/mining-sars-data/">FINCEN Files</a>:</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>In the end, ICIJ and its partners launched a giant data-extraction effort: for more than a year, 85 journalists in 30 countries reviewed and extracted transaction information from assigned suspicious activity reports and manually entered it into Excel files &#8230; The effort resulted in 55,000 records of structured data and included details on more than 200,000 transactions flagged by the banks</p></blockquote>



<p> I believe that this sort of data cleanup work is a far better application of AI to journalism than attempts to automate &#8220;finding the story in the data&#8221; or that sort of thing. The form extraction problem is well-specified, and data prep takes a <em>lot</em> of time, as I&#8217;ve argued at length in <a href="http://jonathanstray.com/papers/Making%20Artificial%20Intelligence%20Work%20for%20Investigative%20Journalism.pdf">Making AI Work for Investigative Journalism</a>.</p>



<h3 class="wp-block-heading">Why is this hard?</h3>



<p>Given that extracting data from paper forms is difficult, expensive, and widely useful you&#8217;d think that this would be solved by now. And it sort of is, but not for the kinds of cases above. </p>



<p>Form extraction is so common in journalism that &#8220;how do I get this data out of a PDF?&#8221; is a <a href="https://gijn.org/2017/07/17/beginners-guide-to-extracting-data-from-pdfs/">FAQ for data journalists</a>. There are a few open-source solutions for table extraction, such as <a href="https://tabula.technology/">Tabula</a>. There are a number of proprietary form and table extraction products at various levels of complexity, ranging from the straightforward <a href="https://www.cometdocs.com/">CometDocs</a> to the sophisticated and expensive <a href="https://web.altair.com/monarch-pdf-to-excel">Monarch</a>. There are also APIs that will turn documents into structured data, such as Amazon&#8217;s <a href="https://aws.amazon.com/textract/">Textract</a> and the Google Cloud Document API, which has a <a href="https://levelup.gitconnected.com/how-to-parse-forms-using-google-cloud-document-ai-68ad47e1c0ed">nice tutorial</a>.</p>



<p>But these products all either require manual interaction to extract data (so they can&#8217;t be used on bulk documents) or they use a template to extract data from a single <em>type</em> of form (which necessitates setup work for each type.) They don&#8217;t do well when the forms are heterogeneous, even if they all contain the same type of data. Unfortunately, that&#8217;s the situation with all the cases above. The problem isn&#8217;t extracting data from a form, but extracting data from <em>any</em> form. This is why AI can help: the ability of machine learning models to generalize may make it possible to extract data from previously unseen forms.</p>



<p>This general form extraction problem is so hard that are entire businesses based around it, like <a href="https://www.expensify.com/">Expensify</a>. And we are beginning to see more flexible AI-driven form extraction products that can learn form layouts, such as <a href="https://rossum.ai/">Rossum.ai</a>. But this sort of technology is proprietary and often specialized to specific types of common business documents. If you need something else, or you need it open source, then it&#8217;s time to get to the research.</p>



<h3 class="wp-block-heading">Generalized Form Extraction: The State of the Art</h3>



<p>Here&#8217;s what I know about solving the form extraction problem. This section is for developers and researchers who want to try to improve on our <a href="https://wandb.ai/deepform/political-ad-extraction/benchmark">benchmark results</a>, or advance the open state of the art. </p>



<p>First, the basics. In many cases, including anything that started on paper, you&#8217;ll need OCR to convert images into text. <a href="https://github.com/tesseract-ocr/tesseract">Tesseract 4.0</a> is near-SOTA OCR in 100+ languages, so you probably want to start there. After you have PDFs with text, you&#8217;ll need to convert them into some representation suitable for machine learning. Deepform uses a tokens-plus-geometry format, where the document is transformed into a list of words (tokens) and their positions on the page. We use <a href="https://github.com/jsvine/pdfplumber">pdfplumber</a> to do this, an amazing tool which will also do many other useful things (like simple table extraction).</p>



<p>From there, the problem is known as &#8220;multimodal form extraction.&#8221; A successful model will have to consider not just the text itself but each word&#8217;s position on the page, and even information like font size or bolded headings. </p>



<p>I know of only one open-source multimodal form extraction system that has been used in production. <a href="https://hazyresearch.stanford.edu/fonduer">Fonduer</a>, from a team at Stanford, starts from rich document structure including geometry, hierarchy, and fonts, then extracts data using a multi-stage process. First, candidate answers are selected through user-written matching functions. The user can also supply small &#8220;labelling&#8221; functions which supply extra information that can help choose the right answers. All these functions are small and simple, typically only a line or two of code. </p>



<div class="wp-block-image"><figure class="aligncenter is-resized"><img loading="lazy" decoding="async" src="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.17.28-PM.png" alt="" class="wp-image-4574" width="528" height="135" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.17.28-PM.png 1002w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.17.28-PM-300x77.png 300w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.17.28-PM-768x196.png 768w" sizes="auto, (max-width: 528px) 100vw, 528px" /><figcaption>Hand-written labelling functions for Fonduer (<a href="https://sing.stanford.edu/site/publications/fonduer-sigmod18.pdf">source</a>)</figcaption></figure></div>



<p>Then, a trained bidirectional-LSTM network uses all this information to choose the correct answers from the candidates.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="1024" height="326" src="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.13.50-PM-1024x326.png" alt="" class="wp-image-4573" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.13.50-PM-1024x326.png 1024w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.13.50-PM-300x95.png 300w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.13.50-PM-768x244.png 768w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-2.13.50-PM.png 1666w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>The Fonduer pipeline (<a href="https://sing.stanford.edu/site/publications/fonduer-sigmod18.pdf">source</a>)</figcaption></figure></div>



<p>Just in the last year, several more noteworthy techniques have appeared. This <a href="https://ai.googleblog.com/2020/06/extracting-structured-data-from.html">work from several Google researchers</a> starts with tokens and geometry  (exactly what PDFPlumber outputs). The process again begins with candidates produced by hand-written matching functions (notice a theme?) followed by a unique classifier. The core idea here is to encode the <em>neighborhood</em> of each token, meaning all tokens within &#8220;a zone around the candidate extending all the way to the left of the page and about 10% of the page height above it.&#8221; The model also learns a separate embedding of a scalar-valued &#8220;field ID&#8221; which indicates whether the field  is an <em>amount_due</em>, an <em>invoice_id</em>, a <em>due_date</em>, etc. The final layer of the network scores each candidate by computing the <a href="https://towardsdatascience.com/understanding-cosine-similarity-and-its-application-fd42f585296a">cosine similarity</a> of the neighborhood embedding and the field type embedding.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="640" height="517" src="http://jonathanstray.com/wp-content/uploads/2020/10/image2.png" alt="" class="wp-image-4575" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/image2.png 640w, http://jonathanstray.com/wp-content/uploads/2020/10/image2-300x242.png 300w" sizes="auto, (max-width: 640px) 100vw, 640px" /><figcaption>General field extraction by learning to represent candidate neighborhoods (<a href="https://ai.googleblog.com/2020/06/extracting-structured-data-from.html">source</a>)</figcaption></figure></div>



<p>Using cosine similarity between the candidate and neighborhood embeddings forces candidates with similar context to be &#8220;near&#8221; to each other in embedding space (and this is actually visualized in the <a href="https://www.aclweb.org/anthology/2020.acl-main.580.pdf">paper</a>.) You can think of each learned field type (<em>field ID</em>) embedding as the centroid of the corresponding cluster of similar neighborhoods. Each neighborhood would include, for example, a human-readable field name, so we should expect at least that much similarity in the context of the correct answer for each field type. </p>



<p>There have also been a graph convolutional network approaches to form extraction, as in this <a href="https://nanonets.com/blog/information-extraction-graph-convolutional-networks/">helpful tutorial on scanning receipts</a>. The idea here is to encode the geometrical relationship between tokens in the document as edges in a graph, e.g. the nodes representing two tokens get an edge between them if they are horizontally or vertically aligned.</p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="475" height="293" src="http://jonathanstray.com/wp-content/uploads/2020/10/pasted-image-0-5-.png" alt="" class="wp-image-4576" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/pasted-image-0-5-.png 475w, http://jonathanstray.com/wp-content/uploads/2020/10/pasted-image-0-5--300x185.png 300w" sizes="auto, (max-width: 475px) 100vw, 475px" /><figcaption>A graph representation of a receipt for information extraction (<a href="https://nanonets.com/blog/information-extraction-graph-convolutional-networks/">source</a>)</figcaption></figure></div>



<p>All of these methods so far are strictly supervised, and they&#8217;ve all been trained on sets of 10,000-ish documents with all fields labelled. It should be possible to start with a (much larger!) large unlabeled corpus of forms to learn general facts about the structure of documents, much as modern <a href="http://jalammar.github.io/illustrated-gpt2/">transformer</a>-based language models train on unlabelled text. The (public?) state-of-the-art in multimodal form extraction is <a href="https://arxiv.org/abs/1912.13318">LayoutLM</a>, which uses text, geometry, and image embeddings in a BERT model.</p>



<figure class="wp-block-image"><img loading="lazy" decoding="async" width="1024" height="517" src="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.02.20-PM-1024x517.png" alt="" class="wp-image-4577" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.02.20-PM-1024x517.png 1024w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.02.20-PM-300x151.png 300w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.02.20-PM-768x387.png 768w, http://jonathanstray.com/wp-content/uploads/2020/10/Screen-Shot-2020-10-24-at-3.02.20-PM.png 1808w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /><figcaption>The LayoutLM architecture pre-trains on text, geometry, and image information. Successive document tokens are horizontal, network layers are vertical (<a href="https://arxiv.org/abs/1912.13318">source</a>)</figcaption></figure>



<p>LayoutLM achieves state-of-the-art performance because it can &#8220;pre-train&#8221; on <a href="https://medium.com/@jdegange85/document-image-datasets-b7f8df01010d">large unlabelled collections of documents</a>, some of which include millions of forms.  It also incorporates image information directly into the multimodal inference, though it&#8217;s not clear to me how much this helps relative to just the text, position, and font size/weight.</p>



<h3 class="wp-block-heading">Deepform: Extracting TV political advertising spending</h3>



<p>Every election, every TV and cable station is required to disclose the political advertising they sell &#8212; but there is no requirement on how they disclose it. These PDFs documents are known as the <a rel="noreferrer noopener" href="https://publicfiles.fcc.gov/" target="_blank">FCC Public Files</a>, and even though every station is disclosing more or less the same information, different stations use different formats. Hundreds of different formats, maybe thousands. </p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="643" height="454" src="http://jonathanstray.com/wp-content/uploads/2020/10/Picture1-1.png" alt="" class="wp-image-4571" srcset="http://jonathanstray.com/wp-content/uploads/2020/10/Picture1-1.png 643w, http://jonathanstray.com/wp-content/uploads/2020/10/Picture1-1-300x212.png 300w" sizes="auto, (max-width: 643px) 100vw, 643px" /><figcaption>One of 40,000 or so political advertising invoices from 2012. Doesn&#8217;t look so bad, but there are hundreds of different form types with the same data.</figcaption></figure></div>



<p>Searching through these forms for newsworthy items, or analyzing them for broader trends, has been a headache for journalists for many years.  Past reporting projects have used massive amounts of<a href="https://www.niemanlab.org/2012/12/crowdsourcing-campaign-spending-what-propublica-learned-from-free-the-files/"> crowdsourced volunteer labor</a> (ProPublica, 2012)&nbsp;or&nbsp;<a href="https://github.com/alexbyrnes/FCC-Political-Ads">hand-coded form layouts</a>&nbsp;(Alex Byrnes, 2014) to produce usable datasets. The option is to buy cleaned data from a political consulting firm for $100k or more, so solving this problem would save journalists tremendous amounts of time or money. </p>



<p>In 2019 I <a href="http://jonathanstray.com/extracting-campaign-finance-data-from-gnarly-pdfs-using-deep-learning">prototyped a deep learning system</a> which could extract one field from the FCC documents with over 90% accuracy, suggesting that it was possible to create a model that could generalize between form types. Today we are announcing <a href="https://wandb.ai/stacey/deepform_v1/reports/DeepForm-Understand-Structured-Documents-at-Scale--VmlldzoyODQ3Njg">Deepform</a>, the result of seven months of work extending this prototype, including:</p>



<ul class="wp-block-list"><li>A <a href="https://github.com/project-deepform/deepform#getting-the-training-data">training data set</a> built from 20,000 labelled FCC Public Files documents from the 2012, 2014, and 2020 elections.</li><li>A <a href="https://github.com/project-deepform/deepform#training">baseline model</a> to extract five fields from each document: order number, advertiser name, flight dates (from and to), and gross amount. </li><li>A <a href="https://wandb.ai/deepform/political-ad-extraction/benchmark">public benchmark</a>, hosted by Weights &amp; Biases, where you can submit your improved model.</li><li>Extracted data for the 2020 election, hosted on <a href="http://overviewdocs.com">Overview</a>.</li></ul>



<p>Compared to the research above, our work uses a relatively simple model. We use pdfplumber to extract tokens and their bounding boxes, then a fully-connected network to score each token within a linear window. These windows, perhaps 20-50 tokens wide, are more or less equivalent to the neighborhoods used in other approaches. Like several of the systems above, we also found that including a few hand-built features based on string matching improved performance. </p>



<div class="wp-block-image"><figure class="aligncenter"><img loading="lazy" decoding="async" width="1020" height="561" src="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM.png" alt="" class="wp-image-4446" srcset="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM.png 1020w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM-300x165.png 300w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM-768x422.png 768w" sizes="auto, (max-width: 1020px) 100vw, 1020px" /><figcaption>The Deepform model. This image is from the <a href="http://jonathanstray.com/extracting-campaign-finance-data-from-gnarly-pdfs-using-deep-learning">2019 prototype</a>, which only extracted the invoice total. The current version has five outputs per token, corresponding to the five fields we extract.</figcaption></figure></div>



<p>The benchmark scores submissions based on average accuracy across five extracted fields. Right now, our baseline model achieves 70%, but this is a bit misleading: we achieve 90% or more on all fields except advertiser name, where we get 30-40%. This is because advertiser name is the only field where the answer spans multiple tokens, so we often get only part of the name, even if it&#8217;s still human recognizable. Actually, most of the models above are not designed to handle multiple token answers either. </p>



<p>The actual extracted data for 2020 available on <a href="http://overviewdocs.com">Overview</a>. You can search, view the original documents and metadata, annotate and download nearly 100,000 invoices and orders from the FCC Public File for the 2020 election. Create an account and choose &#8220;copy an example document set,&#8221; then clone the <em>fcc-data-2020</em> document set.</p>



<p>This data is a little late to be useful to reporters covering the 2020 election. Rather, the significance of Deepform is that it&#8217;s public progress on a difficult and important AI problem. But we have much further to go. If you are an ML engineer who would like to get involved in form-extraction-for-democracy, I&#8217;d encourage you to try your hand at the <a href="https://wandb.ai/deepform/political-ad-extraction/benchmark">public benchmark</a>, very kindly hosted by Weights &amp; Biases. We&#8217;ve done all the hard work of building the data set and a baseline model &#8212; any of the methods discussed above might be quite likely to beat our work. </p>



<p>Finally, a big shoutout to the Deepform team: Gray Davidson, Daniel Fennelly. Andrea Lowe, Hugh Wimberly, and Stacey Svetlichnaya. None of this would have been possible without your dedication over the last seven months.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/to-apply-ai-for-good-think-form-extraction/feed</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>What tools do we have to combat disinformation?</title>
		<link>http://jonathanstray.com/what-tools-do-we-have-to-combat-disinformation</link>
					<comments>http://jonathanstray.com/what-tools-do-we-have-to-combat-disinformation#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Mon, 24 Jun 2019 19:06:47 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4455</guid>

					<description><![CDATA[What types of defenses against disinformation are possible? And which of these would we actually want to use in a democracy, where approaches like censorship can impinge on important freedoms? To try to answer these questions, I looked at what three counter-disinformation organizations are actually doing today, and categorized their tactics. The EU East StratCom Task Force is &#8230; <a href="http://jonathanstray.com/what-tools-do-we-have-to-combat-disinformation" class="more-link">Continue reading <span class="screen-reader-text">What tools do we have to combat disinformation?</span></a>]]></description>
										<content:encoded><![CDATA[<p>What types of defenses against disinformation are possible? And which of these would we actually want to use in a democracy, where approaches like censorship can impinge on important freedoms? To try to answer these questions, I looked at what three counter-disinformation organizations are actually doing today, and categorized their tactics.</p>
<p>The EU East StratCom Task Force is a contemporary government counter-propaganda agency. Facebook has made numerous changes to its operations to try to combat disinformation, and is a good example of what platforms can do. The Chinese information regime is a marvel of networked information control, and provokes questions about what a democracy should and should not do.</p>
<p>The result is the paper <a href="http://jonathanstray.com/papers/Counter-disinformation%20Final.pdf">Institutional Counter-disinformation Strategies in a Networked Democracy</a> (pdf). Here&#8217;s a video of me presenting this work at the the recent <a href="https://sites.google.com/view/misinfoworkshop">Misinfoworkshop</a>.</p>
<p><iframe loading="lazy" title="Institutional Counter-disinformation Strategies in a Networked Democracy" width="660" height="371" src="https://www.youtube.com/embed/hU8f7DIF-ZQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p><span id="more-4455"></span>I should say from the start that this work is not about <em>defining</em> “disinformation.” Adjudicating which speech is harmful is a profound problem with millennia of history, and what sort of narratives are &#8220;false&#8221; is one of the major political battles of our time. Instead, my goal here is to describe methods: what <em>kinds </em>of responses are there, and how do they align with the values of an open society?</p>
<p>The core of my analysis is this chart, which organizes the tactics of the above organizations into six groups.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4456" src="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-24-at-11.57.20-AM.png" alt="Institutional counter-disinformation strategies" width="878" height="622" srcset="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-24-at-11.57.20-AM.png 878w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-24-at-11.57.20-AM-300x213.png 300w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-24-at-11.57.20-AM-768x544.png 768w" sizes="auto, (max-width: 878px) 100vw, 878px" /></p>
<p>I&#8217;ll describe each of these strategies briefly; for more depth (and references) see the talk or the <a href="http://jonathanstray.com/papers/Counter-disinformation%20Final.pdf">paper</a>.</p>
<p><strong>Refutation</strong>, rebuttal, or debunking might be the most obvious counter-strategy. It’s also well within the bounds of democracy, as it’s simply “more speech.” It’s most effective if it&#8217;s done consistently over the long term, and in any case it&#8217;s practiced by most counter-disinformation organizations.</p>
<p><strong>Exposing inauthenticity</strong> combats one of the oldest and best-recognized forms of disinformation: pretending to be someone you are not. Bot networks, &#8220;astroturfing,&#8221; and undisclosed agendas or conflicts of interest could all be considered inauthentic communication. The obvious response is to discredit the source by exposing it.</p>
<p><strong>Alternative narratives.</strong> A long line of experimentation suggests that merely saying that something is false is less effective than providing an alternative narrative, and the non-platforms in this analysis combat disinformation in part by promoting their own narrative</p>
<p><strong>Algorithmic filter manipulation.</strong> The rise of platforms creates a truly new way of countering disinformation: demote it by decreasing its ranking in search results and algorithmically generated feeds. Conversely, it is possible to promote alternative narratives by increasing their ranking.</p>
<p><strong>Speech laws.</strong> The U.S. Supreme Court has held that the First Amendment generally protects lying; the major exceptions concern defamation and fraud. In Europe, the recent report of the High Level Expert Group on Fake News and Online Disinformation recommended against attempting to regulate disinformation. But in most democracies platforms are still legally liable for hosting certain types of content. For example, Germany requires platforms to remove Nazi-related material within 24 hours or face fines.</p>
<p><strong>Censorship.</strong> One way of combatting disinformation is simply to remove it from public view. In the 20th century, censorship was sometimes possible through control over broadcast media. This is difficult with a free press, and it is even harder to eliminate information from a networked ecosystem. Yet platforms do have the power to remove content entirely and often do, both for their own reasons and as required by law. (This differs from speech laws because the latter may impose fines or require disclaimers or otherwise restrict speech without removing it.)</p>
<p>Despite their differences, there are many common patterns between the East StratCom Task Force, Facebook, and the Chinese government.  Each of the methods they use has certain advantages and disadvantages in terms of efficacy and legitimacy &#8212; that is, alignment with the values of an open society.</p>
<p>A cross-sector response &#8212; both distributed and coordinated &#8212; is perhaps the biggest challenge. In societies with a free press there is no one with the power to direct all media outlets and platforms to refute or ignore or publish particular items, and it seems unlikely that people across different sectors of society would even agree on what is disinformation and what is not. In the U.S. the State Department, the Defense Department, academics, journalists, technologists and others have all launched their own more-or-less independent counter-disinformation efforts. In many countries, a coordinated response will require coming to terms with a deeply divided population.</p>
<p>But no matter what we collectively choose to do, citizens will require strong assurances that the strategies employed to counter disinformation are both effective and aligned with democratic values.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/what-tools-do-we-have-to-combat-disinformation/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>An Introduction to Algorithmic Bias and Quantitative Fairness</title>
		<link>http://jonathanstray.com/introduction-to-algorithmic-bias</link>
					<comments>http://jonathanstray.com/introduction-to-algorithmic-bias#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Sat, 15 Jun 2019 20:50:32 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4450</guid>

					<description><![CDATA[There are many kinds of questions about discrimination fairness or bias where data is relevant. Who gets stopped on the road by the police? Who gets admitted to college? Who gets approved for a loan, and who doesn&#8217;t? The data-driven analysis of fairness has become even more important as we start to deploy algorithmic decision &#8230; <a href="http://jonathanstray.com/introduction-to-algorithmic-bias" class="more-link">Continue reading <span class="screen-reader-text">An Introduction to Algorithmic Bias and Quantitative Fairness</span></a>]]></description>
										<content:encoded><![CDATA[<p>There are many kinds of questions about discrimination fairness or bias where data is relevant. Who gets stopped on the road by the police? Who gets admitted to college? Who gets approved for a loan, and who doesn&#8217;t? The data-driven analysis of fairness has become even more important as we start to deploy algorithmic decision making across society.</p>
<p>I attempted to synthesize an introductory framework for thinking about what fairness means in a quantitative sense, and how these mathematical definitions connect to legal and moral principles and our real world institutions of criminal justice, employment, lending, and so on. I ended up with two talks.</p>
<p>This short talk (20 minutes), part of a <a href="https://www.ire.org/events-and-training/event/3434/4448/">panel</a> at the Investigative Reporters &amp; Editors conference, has no math. (<a href="https://www.slideshare.net/JonathanStray/analyzing-bias-in-data-ire-2019">Slides</a>)</p>
<p><iframe loading="lazy" title="Analyzing Bias in Data - IRE 2019" width="660" height="371" src="https://www.youtube.com/embed/vnRhZVbgIbo?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>This longer talk (50 minutes), presented at Code for America SF, gets into a lot more depth, including the mathematical definitions of different types of fairness, and the whole tricky issue of whether or not algorithms should be &#8220;blinded&#8221; to attributes like race and gender. It also includes several case studies of real algorithmic systems, and discusses how we might design such systems to reduce bias. (<a href="https://www.slideshare.net/JonathanStray/frameworks-for-algorithmic-bias">Slides</a>)</p>
<p><iframe loading="lazy" title="Frameworks for Algorithmic Bias" width="660" height="371" src="https://www.youtube.com/embed/fWxPTYht8HU?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>My favorite resources on these topics:</p>
<ul>
<li>The Workbench <a href="https://app.workbenchdata.com/workflows/5059/">workflow</a> analyzing Massachusetts traffic ticket data.</li>
<li>Sandra Mayson, <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3257004">Bias In, Bias Out</a>. One of my favorite overall discussions of algorithmic bias.</li>
<li>Megan Stevenson, <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3016088">Assessing Risk Assessment in Action</a>. What happens with criminal justice risk assessment in the real world?</li>
<li>Corbett-Davies and Goel, <a href="https://arxiv.org/abs/1808.00023">The Measure and Mismeasure of Fairness</a> is a well done more mathematical discussions of fairness measures.</li>
<li>Open Policing Project <a href="https://openpolicing.stanford.edu/findings/">findings</a>. A very clearly thought out analysis of US national traffic stop data.</li>
<li>Workbench <a href="https://app.workbenchdata.com/workflows/18232/">Open Policing Project tutorial</a>. An interactive introduction to working with this data.</li>
<li>Arvind Narayanan, <a href="https://www.youtube.com/watch?v=jIXIuYdnyyk">21 Definitions of Fairness and Their Politics</a>. More on the connection between quantitative and political concepts of fairness.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/introduction-to-algorithmic-bias/feed</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Extracting campaign finance data from gnarly PDFs using deep learning</title>
		<link>http://jonathanstray.com/extracting-campaign-finance-data-from-gnarly-pdfs-using-deep-learning</link>
					<comments>http://jonathanstray.com/extracting-campaign-finance-data-from-gnarly-pdfs-using-deep-learning#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Thu, 13 Jun 2019 19:52:05 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4444</guid>

					<description><![CDATA[Update, Oct 2020: we&#8217;ve done a lot more since this post! If you want to try working on this problem, Weights and Biases is very kindly hosting a public benchmark. I&#8217;ve just completed an experiment to extract information from TV station political advertising disclosure forms using deep learning. In the process I&#8217;ve produced a challenging &#8230; <a href="http://jonathanstray.com/extracting-campaign-finance-data-from-gnarly-pdfs-using-deep-learning" class="more-link">Continue reading <span class="screen-reader-text">Extracting campaign finance data from gnarly PDFs using deep learning</span></a>]]></description>
										<content:encoded><![CDATA[<p><em>Update, Oct 2020: we&#8217;ve done <a href="https://github.com/project-deepform/deepform">a lot more</a> since this post! If you want to try working on this problem, Weights and Biases is very kindly hosting a <a href="https://wandb.ai/deepform/political-ad-extraction/benchmark">public benchmark</a>.</em></p>
<p>I&#8217;ve just completed an experiment to extract information from TV station political advertising disclosure forms using deep learning. In the process I&#8217;ve produced a challenging journalism-relevant dataset for NLP/AI researchers. Original data from ProPublica&#8217;s <a href="https://projects.propublica.org/free-the-files/" rel="nofollow">Free The Files</a> project.</p>
<p>The resulting model achieves 90% accuracy extracting total spending from the PDFs in the (held out) test set, which shows that deep learning can generalize surprisingly well to previously unseen form types. I expect it could be made much more accurate through some feature engineering (see below.)</p>
<p><iframe loading="lazy" title="Deepform: using deep learning to unlock campaign finance data" width="660" height="371" src="https://www.youtube.com/embed/uNN59kJQ7CA?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>You can find the code and documentation <a href="https://github.com/jstray/deepform">here</a>. Full thanks to my collaborator Nicholas Bardy of Weights &amp; Biases.</p>
<p><strong>Why?</strong></p>
<p>TV stations are required to disclose their sale of political advertising, but there is no requirement that this disclosure is machine readable. Every election, tens of thousands of PDFs are posted to the FCC Public File, available at <a href="https://publicfiles.fcc.gov/" rel="nofollow">https://publicfiles.fcc.gov/</a>. All of these contain essentially the same information, but in in hundreds of different formats, like these:</p>
<p><span id="more-4444"></span></p>
<p><a href="http://jonathanstray.com/wp-content/uploads/2019/06/Picture1.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-4506 size-medium" src="http://jonathanstray.com/wp-content/uploads/2019/06/Picture1-300x212.png" alt="" width="300" height="212" srcset="http://jonathanstray.com/wp-content/uploads/2019/06/Picture1-300x212.png 300w, http://jonathanstray.com/wp-content/uploads/2019/06/Picture1.png 643w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p><a href="http://jonathanstray.com/wp-content/uploads/2019/06/Picture2.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-4505 size-medium" src="http://jonathanstray.com/wp-content/uploads/2019/06/Picture2-300x166.png" alt="" width="300" height="166" srcset="http://jonathanstray.com/wp-content/uploads/2019/06/Picture2-300x166.png 300w, http://jonathanstray.com/wp-content/uploads/2019/06/Picture2.png 679w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><a href="http://jonathanstray.com/wp-content/uploads/2019/06/Picture3.png"><img loading="lazy" decoding="async" class="aligncenter wp-image-4504 size-medium" src="http://jonathanstray.com/wp-content/uploads/2019/06/Picture3-300x204.png" alt="" width="300" height="204" srcset="http://jonathanstray.com/wp-content/uploads/2019/06/Picture3-300x204.png 300w, http://jonathanstray.com/wp-content/uploads/2019/06/Picture3.png 629w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a></p>
<p>In 2012, ProPublica ran the Free The Files project (you can <a href="https://www.niemanlab.org/2012/12/crowdsourcing-campaign-spending-what-propublica-learned-from-free-the-files/" rel="nofollow">read how it worked</a>) and hundreds of volunteers hand-entered information for over 17,000 of these forms. That data drove a bunch of campaign finance <a href="https://www.propublica.org/series/free-the-files" rel="nofollow">coverage</a> and is now <a href="https://www.propublica.org/datastore/dataset/free-the-files-filing-data" rel="nofollow">available</a> from their data store.</p>
<p>Can we replicate this data extraction using modern deep learning techniques? This project aimed to find out, and successfully extracted the easiest of the fields (total amount) at 90% accuracy using a relatively simple network.</p>
<p><strong>How it works</strong></p>
<p>I settled on a relatively simple design, using a fully connected three-layer network trained on 20 token windows of the data. Each token is hashed to an integer mod 500, then converted to 1-hot representation and embedded into 32 dimensions. This embedding is combined with geometry information (bounding box and page number) and also some hand-crafted &#8220;hint&#8221; features, such as whether the token matches a regular expression for dollar amounts. For details, see <a href="https://www.youtube.com/watch?v=uNN59kJQ7CA" rel="nofollow">the talk</a>.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4446" src="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM.png" alt="Deepform network" width="1020" height="561" srcset="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM.png 1020w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM-300x165.png 300w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.57.59-PM-768x422.png 768w" sizes="auto, (max-width: 1020px) 100vw, 1020px" /></p>
<p>Although 90% is a good result, it&#8217;s probably not high enough for production use. However, I believe this approach has lots of room for improvement. The advantage of this type of system is that it can elegantly integrate multiple manual extraction methods — the &#8220;hint&#8221; features — each of which can be individually crappy. The network actually learns when to trust each method. In ML speak this is &#8220;boosting over weak learners.&#8221;</p>
<p><strong>A research data set</strong></p>
<p>Are you an AI researcher looking for challenging research problems that are relevant to investigative journalism? Have I got a <a href="https://github.com/jstray/deepform#training-data-format">data set</a> for you!</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4447" src="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.58.33-PM.png" alt="Deepform data set" width="1015" height="455" srcset="http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.58.33-PM.png 1015w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.58.33-PM-300x134.png 300w, http://jonathanstray.com/wp-content/uploads/2019/06/Screen-Shot-2019-06-13-at-12.58.33-PM-768x344.png 768w" sizes="auto, (max-width: 1015px) 100vw, 1015px" /></p>
<p>There is a great deal left to do on this extraction project. For example, we still need to try extracting the other fields such as advertiser and TV station call sign. This will probably be harder than totals as it&#8217;s harder to identify tokens which &#8220;look like&#8221; the correct answer.</p>
<p>There is also more data preparation work to do. We discovered that about 30% of the PDFs documents still need OCR, which should increase our training data set from 9k to ~17k documents.</p>
<p>But even in its current form, this is a difficult data set that is very relevant to journalism, and improvements in technique will be immediately useful to campaign finance reporting.</p>
<p>The general problem is known as &#8220;knowledge base construction&#8221; in the research community, and the current state of the art is achieved by multimodal systems such as <a href="https://fonduer.readthedocs.io/en/latest/" rel="nofollow">Fonduer</a>.</p>
<p>I would love to hear from you! Contact me on <a href="https://twitter.com/jonathanstray" rel="nofollow">twitter</a> or <a href="http://jonathanstray.com/contact-me" rel="nofollow">here</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/extracting-campaign-finance-data-from-gnarly-pdfs-using-deep-learning/feed</wfw:commentRss>
			<slash:comments>9</slash:comments>
		
		
			</item>
		<item>
		<title>Ethical Software Engineering Lab Course</title>
		<link>http://jonathanstray.com/ethical-engineering-lab-course</link>
					<comments>http://jonathanstray.com/ethical-engineering-lab-course#respond</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Sun, 12 May 2019 00:38:27 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4426</guid>

					<description><![CDATA[There is now, at long last, wide concern over the negative effects of technology, along with calls to teach ethics to engineers. But critique is not enough. What tools are available to the working engineer to identify and mitigate the potential harms of their work? I&#8217;ve been teaching the effects of technology on society for some time, and we cover a lot of &#8230; <a href="http://jonathanstray.com/ethical-engineering-lab-course" class="more-link">Continue reading <span class="screen-reader-text">Ethical Software Engineering Lab Course</span></a>]]></description>
										<content:encoded><![CDATA[<p>There is now, at long last, wide concern over the negative effects of technology, along with <a href="https://news.harvard.edu/gazette/story/2019/01/harvard-works-to-embed-ethics-in-computer-science-curriculum/">calls</a> to teach ethics to engineers. But critique is not enough. What tools are available to the working engineer to identify and mitigate the potential harms of their work?</p>
<p>I&#8217;ve been teaching the effects of technology on society for some time, and we cover a lot of it in my <a href="http://www.compjournalism.com/">computational journalism course</a>. This is an outline for a broader hands-on course, which I&#8217;m calling the Ethical Engineering Lab.</p>
<p>This eight-week course is a hands-on introduction to the practice of what you might call harm-aware software engineering. I&#8217;ve structured it around the Institute for the Future&#8217;s <a href="https://ethicalos.org/">Ethical OS</a>, a framework I&#8217;ve found useful for categorizing the places where technology intersects with personal and social harm. Each class is three hours long, split between lecture and lab time. Students must complete a project investigating actual or potential harms from technology, and their mitigations.</p>
<p>Each lecture is structured around a set of <em>issues</em>, cases where technology is or could be involved in harm, and <em>tools</em>, methods for mitigating these harms. The goal is to train students in the current state-of-the-art of these problems, which often requires a deep dive into both the social and technical perspectives. We will study both differential privacy algorithms and HIPAA health data privacy. In many cases there is disagreement over the potential for certain harms and their seriousness, so we will explore the tradeoffs of possible design choices.</p>
<p><span id="more-4426"></span></p>
<p>Our hands-on exploration (lab time and final projects) will involve a combination of qualitative and quantitative methods. For example, we might read the EULAs of all the products we use and see if there are any surprises. Or we might use a Jupyter notebook with real data from the COMPAS criminal justice risk assessment algorithm to investigate the tradeoffs between different definitions of quantitative fairness. I&#8217;ve included example <em>projects</em> that students could do in each area.</p>
<p>Some technical background is required, as the goal is to teach the engineering aspects of these problems. Many but not all final projects will require coding. I particularly encourage students to choose a project related to their work.</p>
<p>This post is just a sketch to suggest the sort of material I&#8217;d want to include. Doubtless, a great many things are missing. What else should we cover? What references are especially good on these topics? Do you want me to teach this at your organization? <a href="http://jonathanstray.com/contact-me">Get in touch</a>.</p>
<p><strong> Truth, Disinformation, Propaganda</strong></p>
<p>Issues</p>
<ul>
<li>Overview of recent disinformation campaigns (2016 election and globally).</li>
<li>Disinformation <a href="https://science.sciencemag.org/content/359/6380/1146">spreads farther than truth</a>.</li>
<li>Review of current state-of-the-art in audio, video, text, and photo deepfakes.</li>
<li>Defining “propaganda.” The <a href="https://docs.google.com/presentation/d/1Lja3PqvfrZh0tbtJB-5-5xxE0UMFdeEwo7qeAEA_xgA/edit">ethics of persuasion</a>.</li>
<li>What the most advanced chatbots can do today.</li>
</ul>
<p>Tools</p>
<ul>
<li>Contemporary <a href="https://www.youtube.com/watch?v=hU8f7DIF-ZQ">institutional counter-disinformation practices</a>.</li>
<li>Recommendation algorithms: design patterns for various social goals.</li>
<li>Moderation system design.</li>
<li>How Facebook responds to <a href="https://fbnewsroomus.files.wordpress.com/2017/04/facebook-and-information-operations-v1.pdf">information operations</a>.</li>
<li>Associated Press <a href="https://www.slideshare.net/smyles/how-can-we-make-algorithmic-news-more-transparent-98053867">guidelines for identifying machine-written content</a>.</li>
</ul>
<p>Discussions</p>
<ul>
<li>How could your technology be used as part of a disinformation campaign?</li>
</ul>
<p>Example Projects</p>
<ul>
<li>Build a chatbot that impersonates a person or company. See if you can fool your classmates.</li>
<li>Build a fake news classifier from one of the common fake news datasets. What signals does it end up learning? Can it be made to work at scale?</li>
</ul>
<p><strong> </strong></p>
<p><strong> Addiction &amp; The Dopamine Economy</strong></p>
<p>Issues</p>
<ul>
<li>Addiction psychology, through the example of gambling and casino design.</li>
<li>Defining &#8220;engagement&#8221; and the effects of optimizing for it.</li>
<li>Effects of screens on sleep.</li>
<li>&#8220;Ultra-FOMO&#8221;: What do constant images of perfection do to us?</li>
</ul>
<p>Tools</p>
<ul>
<li>“time well spent” metrics; well-being research</li>
<li>Screen time reports</li>
<li>Human and algorithmic approaches to evaluating content quality</li>
</ul>
<p>Discussion</p>
<ul>
<li>What would addiction look like on your platform?</li>
<li>How can your business make money without addiction?</li>
</ul>
<p>Example Projects</p>
<ul>
<li>Estimate quantitative effect of removing a particular addictive feature. Or implement a change to your product and find out.</li>
<li>Build a machine learning system that ranks content by &#8220;quality,&#8221; in the &#8220;time well spent&#8221; sense. What measure are you using, and why, and how does the classifier perform relative to this standard?</li>
</ul>
<p><strong>Economic and Asset Inequalities</strong></p>
<p>Issues</p>
<ul>
<li>Personalized pricing can <a href="https://www.wsj.com/articles/SB10001424127887323777204578189391813881534">charge poorer people more</a>. This doesn’t have be intentional; a very simple three line algorithm will do it.</li>
<li>Pricing AIs will <a href="https://voxeu.org/article/artificial-intelligence-algorithmic-pricing-and-collusion">collude to fix prices</a>.</li>
<li>Auto insurance continues to be <a href="https://www.propublica.org/article/minority-neighborhoods-higher-car-insurance-premiums-white-areas-same-risk">more expensive in minority neighborhoods</a>, even after adjusting for risk.</li>
</ul>
<p>Example Projects</p>
<ul>
<li>Reproduce the simulation which showed that pricing algorithms will collude. Under what conditions will this happen? How can AIs be designed not to do this?</li>
<li>Analyze real lending data to determine the demographics of who gets a loan now, and how that would change if better prediction was available, as <a href="https://github.com/jstray/lede-algorithms/blob/master/week-5/week-5-2-lending-class.ipynb">this notebook does</a>.</li>
<li>Simulate personalized pricing, using a model to estimate of willingness to pay of different demographics (location, age, etc.). How will this affect the distribution of prices between different income levels?</li>
</ul>
<p><strong> Machine Ethics &amp; Algorithmic Biases</strong></p>
<p>Issues</p>
<ul>
<li>A framework for thinking about <a href="https://www.youtube.com/watch?v=vnRhZVbgIbo">analyzing data for evidence of bias</a>.</li>
<li>Google <a href="https://www.washingtonpost.com/news/the-intersect/wp/2015/07/06/googles-algorithm-shows-prestigious-job-ads-to-men-but-not-to-women-heres-why-that-should-worry-you">shows ads for higher paid job to men</a>.</li>
<li>Sexism in word embeddings: <a href="https://www.technologyreview.com/s/602025/how-vector-space-mathematics-reveals-the-hidden-sexism-in-language/">Man is to programmer as woman is to housewife</a>, however, there was an instructive <a href="https://twitter.com/rikvannoord/status/1132933236756238341">error in the research</a> that led to this particular example.</li>
<li>Better loan payback prediction will <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3072038">increase disparities in interest rates</a>.</li>
<li>Ethical problems with <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3257004">prediction in general in criminal justice</a>.</li>
<li>Prediction feedback loops,</li>
</ul>
<p>Tools</p>
<ul>
<li>Introduction to <a href="https://www.slideshare.net/JonathanStray/frontiers-of-computational-journalism-week-6-quantitative-fairness#24">quantitative fairness measures</a>. Three classic types, their advantages and drawbacks. 1) Demographic parity: hire the same number of men and women. 2) Equal error rates: make sure the classifier fails the same amount for different races. 3) Calibration: ensure a prediction means the same for all groups.</li>
<li>Stanford&#8217;s Law, Bias, and Algorithms <a href="https://github.com/stanford-policylab/law-bias-algo">course notebooks</a>.</li>
<li>Impossibility theorem: you can only have one of these at once when base rates differ between groups. Type of fairness is a policy choice.</li>
<li>Real world outcomes. After recidivism prediction was introduced in Kentucky, judges <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3016088">initially reduced detainment rates</a> in accordance with computed risk scores but the effect gradually wore off. A detailed analysis of the <a href="http://proceedings.mlr.press/v81/chouldechova18a.html">effect of predicting</a> which children will likely require intervention by child protection services.</li>
</ul>
<p>Example Projects</p>
<ul>
<li>Quantify the tradeoffs between different types of fairness in the COMPAS criminal justice risk assessment data set, as in <a href="https://github.com/jstray/lede-algorithms#week-5-1---machine-bias">this notebook</a>.</li>
<li>Simulate and analyze the <a href="https://arxiv.org/abs/1706.09847">feedback loops in predictive policing</a>.</li>
</ul>
<p><strong>The Surveillance State</strong></p>
<p><strong> </strong>Issues</p>
<ul>
<li><a href="https://www.scmp.com/news/china/politics/article/2185303/hi-tech-dystopia-or-low-key-incentive-scheme-complex-reality?utm_campaign=the_algorithm.unpaid.engagement&amp;utm_source=hs_email&amp;utm_medium=email&amp;utm_content=70265531&amp;_hsenc=p2ANqtz-81DDJ4pbAZpUMBUOft5jlQg_j5Mnu0xElyjI6takQ8rdcEAcSBMLb_X9qagK1sQXPSq2z7JWn-MphY2lJgWqoldvNI_w&amp;_hsmi=70265531">China’s inept “social credit system”</a> and the much more sophisticated <a href="https://www.hrw.org/video-photos/interactive/2019/05/02/china-how-mass-surveillance-works-xinjiang">surveillance system used by police in Xinjiang</a>.</li>
<li><a href="http://qz.com/763900/surveillance-and-gentrification/">Surveillance by landords</a>, including video cameras and social media monitoring, is being used to harass and evict tenants.</li>
<li>The <a href="https://slate.com/technology/2016/08/theres-no-such-thing-as-innocuous-personal-data.html">potential costs</a> of sharing your heart rate and other health data.</li>
<li>Western companies <a href="https://www.washingtonpost.com/outlook/2019/01/17/how-us-surveillance-technology-is-propping-up-authoritarian-regimes/?utm_term=.aaadcd510555">selling surveillance tech to authoritarian regimes</a>, and <a href="https://qz.com/1613020/tiktok-might-be-a-chinese-cambridge-analytica-scale-privacy-threat/">Chinese products collecting data</a> for the government.</li>
</ul>
<p>Scenarios</p>
<ul>
<li>Data mining tools used for investigative journalism are re-purposed for harassment</li>
<li>China’s social credit system grows up and is applied to users worldwide to enforce authoritarian norms.</li>
<li>Police facial recognition cameras effectively track every citizen’s location, bypassing 4<sup>th</sup> amendment protections on tracking.</li>
</ul>
<p>Discussions</p>
<ul>
<li>What are the technical, legal, and social factors that prevent law enforcement from abusing mass surveillance – in each country? How will your technology interact with these</li>
</ul>
<p>Project Ideas</p>
<ul>
<li>With their prior permission, investigate a classmate through public information only. What can you correctly infer about their life?</li>
<li>Publicly display your heart rate for a week and report your results.</li>
</ul>
<p><strong> Data Control &amp; Monetization</strong></p>
<p>Issues</p>
<ul>
<li>Data privacy law primer, including GDPR and HIPPA.</li>
<li>Inadvertent collection of data. <a href="https://googleblog.blogspot.com/2010/05/wifi-data-collection-update.html">Google Wifi</a>, <a href="https://techcrunch.com/2018/02/05/mixpanel-passwords/">Mixpanel passwords</a>.</li>
<li>Data leaks due to mistakes and hacks.</li>
<li>The effect of making ostensibly “public” data more available or interpretable. E.g. <a href="https://slate.com/technology/2019/03/graffititracker-san-diego-vandalism-technology-past-crimes.html">Graffiti tracker</a>, The Journal News’ <a href="https://www.poynter.org/reporting-editing/2012/where-the-journal-news-went-wrong-in-publishing-names-addresses-of-gun-owners/">gun map</a>.</li>
</ul>
<p>Tools</p>
<ul>
<li>Redaction and minimization. Differential privacy, through the example of the new privacy changes for the 2020 Census.</li>
<li>Location data. How <a href="https://www.nytimes.com/interactive/2018/12/10/business/location-data-privacy-apps.html">much it reveals</a>, how easy it is to <a href="https://research.neustar.biz/2014/09/15/riding-with-the-stars-passenger-privacy-in-the-nyc-taxicab-dataset/">de-anonymize</a>.</li>
<li>Health data. Correlations with life outcomes. Regulatory issues.</li>
<li>Issues of personalized recommendations and ads, e.g. targeting ads to pregnant women.</li>
<li>General effects of better prediction on the distribution of resources and risk. For example, if you had perfect information on someone’s future health, would that destroy the health insurance market?</li>
</ul>
<p>Discussions</p>
<ul>
<li>What data do you collect? Split into small groups, discuss and make a list, merge lists. Were any types of data not listed by a group because you were missing someone with a specific perspective?</li>
<li>What rights would your users want in regards to their data? What problems will they have if they don’t have these rights?</li>
</ul>
<p>Example projects</p>
<ul>
<li>Experiment with adding differential privacy to one of your APIs. How easy is it to learn personal information, via reconstructions from multiple API calls, before and after?</li>
<li>Reconstruct someone’s life from anonymized location data (someone in the class could give it to you, or you could use the NYC taxi data, or data from apps.)</li>
</ul>
<p><strong>Implicit Trust and User Understanding</strong></p>
<p>Issues</p>
<ul>
<li><a href="https://www.businessinsider.com/deloitte-study-91-percent-agree-terms-of-service-without-reading-2017-11">No one reads EULAs</a></li>
<li>Unroll.me was <a href="https://www.nytimes.com/2017/04/24/technology/personal-data-firm-slice-unroll-me-backlash-uber.html">reading your email</a> for Lyft receipts and reporting to Uber</li>
<li><a href="https://www.darkpatterns.org/types-of-dark-pattern">Dark Patterns</a> in UI design</li>
</ul>
<p>Projects:</p>
<ul>
<li>Take one day of your browser history, re-visit every site. Read the EULAs and record anything that surprises you.</li>
<li>Document the dark patterns you encounter on these sites.<strong> </strong></li>
</ul>
<p><strong> </strong></p>
<p><strong> Hateful &amp; Criminal Actors</strong></p>
<p>Issues</p>
<ul>
<li>The challenge of platform counter-terrorism, from <a href="https://tnsr.org/2019/04/crossroads-counter-terrorism-and-the-internet/">Facebook’s point of view</a>.</li>
<li>Bibliography of <a href="https://medium.com/@carolinesinders/current-reading-list-of-papers-on-online-harassment-and-machine-learning-c70fe674f9d1">papers on online harassment and machine learning</a>.</li>
<li><a href="https://openai.com/blog/adversarial-example-research/">Attacks on image recognition algorithms</a>: wear a t-shirt and confuse an AI.</li>
<li>It is now possible to run <a href="https://www.blackhat.com/docs/us-16/materials/us-16-Seymour-Tully-Weaponizing-Data-Science-For-Social-Engineering-Automated-E2E-Spear-Phishing-On-Twitter-wp.pdf">automated spear-phishing</a>.</li>
<li>The Darkweb, anonymity, and security, as told through <a href="https://www.wired.com/2015/04/silk-road-1/">the story of The Silk Road</a>.</li>
</ul>
<p>Example Projects</p>
<ul>
<li>Build a hate speech classifier. Does it work well enough to be useful? What have you learned about the complexity of this problem?</li>
<li>Estimate the percentage of bitcoin transactions which are used for criminal activity</li>
<li>Pick a platform or product. Come up with a plan to use it for criminal activity, including the security measures you would take.</li>
</ul>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/ethical-engineering-lab-course/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Introducing Workbench</title>
		<link>http://jonathanstray.com/introducing-the-cj-workbench</link>
					<comments>http://jonathanstray.com/introducing-the-cj-workbench#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Thu, 02 Mar 2017 19:05:26 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4352</guid>

					<description><![CDATA[Some of you may have heard about by new data journalism project &#8212; The Computational Journalism Workbench. This is an integrated platform for data journalism, combining scraping, analysis, and visualization in one easy tool. It works by assembling simple modules into a “workflow,” a repeatable, sharable, automatically updating pipeline that produces a publishable chart or &#8230; <a href="http://jonathanstray.com/introducing-the-cj-workbench" class="more-link">Continue reading <span class="screen-reader-text">Introducing Workbench</span></a>]]></description>
										<content:encoded><![CDATA[<p>Some of you may have heard about by new data journalism project &#8212; The Computational Journalism Workbench. This is an integrated platform for data journalism, combining scraping, analysis, and visualization in one easy tool. It works by assembling simple modules into a “workflow,” a repeatable, sharable, automatically updating pipeline that produces a publishable chart or a live API endpoint.</p>
<p>I demonstrated a prototype at the NICAR conference. UPDATE: Workbench is now in production at <a href="http://workbenchdata.com">workbenchdata.com</a> and has now been used in teaching in dozens of schools.</p>
<p><iframe loading="lazy" title="Workbench - overview" src="https://player.vimeo.com/video/295956416?dnt=1&amp;app_id=122963" width="660" height="371" frameborder="0" allow="autoplay; fullscreen; picture-in-picture; clipboard-write; encrypted-media; web-share" referrerpolicy="strict-origin-when-cross-origin"></iframe></p>
<p>I&#8217;ll be working on Workbench for at least the next few years. My previous large data journalism project is the <a href="http://overviewdocs.com">Overview</a> document mining system, which continues active development.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/introducing-the-cj-workbench/feed</wfw:commentRss>
			<slash:comments>11</slash:comments>
		
		
			</item>
		<item>
		<title>Defense Against the Dark Arts: Networked Propaganda and Counter-Propaganda</title>
		<link>http://jonathanstray.com/networked-propaganda-and-counter-propaganda</link>
					<comments>http://jonathanstray.com/networked-propaganda-and-counter-propaganda#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Fri, 24 Feb 2017 22:00:42 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4290</guid>

					<description><![CDATA[In honor of MisinfoCon&#160;this weekend, it&#8217;s time&#160;for a brain dump on propaganda &#8212; that is, getting large numbers of people to believe something for political gain.&#160;Many of my journalist and technologist colleagues&#160;have started to think about propaganda in the wake of the US election,&#160;and related issues like &#8220;fake news&#8221;&#160;and organized&#160;trolling.&#160;My goal here is to connect &#8230; <a href="http://jonathanstray.com/networked-propaganda-and-counter-propaganda" class="more-link">Continue reading <span class="screen-reader-text">Defense Against the Dark Arts: Networked Propaganda and Counter-Propaganda</span></a>]]></description>
										<content:encoded><![CDATA[<p>In honor of <a href="http://www.misinfocon.com/">MisinfoCon</a>&nbsp;this weekend, it&#8217;s time&nbsp;for a brain dump on propaganda &#8212; that is, getting large numbers of people to believe something for political gain.&nbsp;Many of my journalist and technologist colleagues&nbsp;have started to think about propaganda in the wake of the US election,&nbsp;and related issues like &#8220;fake news&#8221;&nbsp;and organized&nbsp;trolling.&nbsp;My goal here is to connect this new wave of enthusiasm to&nbsp;history and research.</p>
<p>This post is about persuasion. I&#8217;m not going to spend much time on the ethics of these techniques, and even less on the question of who is actually right on any&nbsp;particular point. That&#8217;s for another conversation. Instead, I want to talk about&nbsp;<em>what works.&nbsp;</em>All of these methods are just&nbsp;tools, and some&nbsp;are more just than others.&nbsp;Think of this as Defense Against the&nbsp;Dark Arts.</p>
<p>Let&#8217;s start with the nation states. Modern intelligence services have been involved in propaganda for a very long time and they have many names for it: information warfare, political influence operations, disinformation, psyops. Whatever you want to call it, it pays to study the masters.</p>
<p><span id="more-4290"></span></p>
<p><strong>Russia:&nbsp;You don&#8217;t need to be true or consistent</strong></p>
<p>Russia has a long history of organized disinformation, and their methods have&nbsp;evolved for the Internet era. The modern strategy has been dubbed &#8220;the firehose of falsehood&#8221; by RAND scholar Christopher Paul.</p>
<p><iframe loading="lazy" title="Putin’s Propaganda Machine and Possible U.S. Responses" width="660" height="371" src="https://www.youtube.com/embed/FSFG4F-JldQ?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>His <a href="http://www.rand.org/pubs/perspectives/PE198.html">recent report</a> discusses this technique of pushing out diverse messages on a huge number of different channels, everything from&nbsp;obvious state sources like Russia Today&nbsp;to carefully obscured leaks of hacked material &#8212; leaks which&nbsp;are tailored to appeal to&nbsp;sympathetic journalists.</p>
<blockquote>
<div class="page" title="Page 3">
<div class="layoutArea">
<div class="column">
<p>The experimental psychology literature suggests that, all other things being equal, messages received in greater volume and from more sources will be more persuasive. Quantity does indeed have a quality all its own. High volume can deliver other benefits that are relevant in the Russian propaganda context. First, high volume can consume the attention and other available bandwidth of potential audiences, drowning out competing messages. Second, high volume can overwhelm competing messages in a flood of disagreement. Third, multiple channels increase the chances that target audiences are exposed to the message. Fourth, receiving a message via multiple modes and from multiple sources increases the message’s perceived credibility, especially if a disseminating source is one with which an audience member identifies.</p>
</div>
</div>
</div>
</blockquote>
<p>And as you might expect, there is a certain amount of outright fabrication &#8212; often mixed with the truth:</p>
<blockquote>
<div class="page" title="Page 5">
<div class="layoutArea">
<div class="column">
<p>Contemporary Russian propaganda makes little or no commitment to the truth. This is not to say that all of it is false. Quite the contrary: It often contains a significant fraction of the truth. Sometimes, however, events reported in Russian propaganda are wholly manufactured, like the 2014 social media campaign to create panic about an explosion and chemical plume in St. Mary’s Parish, Louisiana, that never happened. Russian propaganda has relied on manufactured evidence—often photographic. &#8230; In addition to manufacturing information, Russian propagandists often manufacture sources.</p>
</div>
</div>
</div>
</blockquote>
<p>But for me, the most surprising conclusion of this work&nbsp;is that a source can still be credible even if it repeatedly and blatantly contradicts itself:</p>
<div class="page" title="Page 8">
<div class="layoutArea">
<div class="column">
<blockquote><p>Potential losses in credibility due to inconsistency are potentially offset by synergies with other characteristics of contemporary propaganda. As noted earlier in the discussion of multiple channels, the presentation of multiple arguments by multiple sources is more persuasive than either the presentation of multiple arguments by one source or the presentation of one argument by multiple sources. These losses can also be offset by peripheral cues that enforce perceptions of credibility, trustworthiness, or legitimacy. Even if a channel or individual propagandist changes accounts of events from one day to the next, viewers are likely to evaluate the credibility of the new account without giving too much weight to the prior, “mistaken” account, provided that there are peripheral cues suggesting the source is credible.</p></blockquote>
</div>
</div>
</div>
<p>Orwell was right: &#8220;We have always been at war with Eastasia&#8221; really does work, if&nbsp;there are enough people repeating&nbsp;it.</p>
<p>Paul suggests&nbsp;that the counter-strategy is not to try to refute the&nbsp;message, but to reach the target audience first with an alternative. Fact checking, which is really after-the-fact-checking, may not be the most effective plan. &nbsp;He suggests instead that we &#8220;forewarn audiences of misinformation, or merely reach them first with the truth, rather than retracting or refuting false &#8216;facts.'&#8221; In this light, Facebook&#8217;s <a href="http://www.theverge.com/2016/12/15/13960062/facebook-fact-check-partnerships-fake-news">plan</a> to show the fact check along with the article seems like a much better strategy than sending someone a fact checking link when they repeat a falsehood.</p>
<p>He also suggests that&nbsp;we&nbsp;&#8220;focus on guiding the propaganda&#8217;s target audience in more productive directions.&#8221; Which is exactly what China does.</p>
<p><strong>China: Don&#8217;t argue, distract and disrupt</strong></p>
<p>China is famous for its highly developed network censorship, from the Great Firewall to its carefully policed social media. The role of the government &#8220;public opinion guides,&#8221; China&#8217;s millions of paid commenters, has been murkier &#8212; until now.</p>
<p>https://www.youtube.com/watch?v=xi-B3_BsL-M</p>
<p>The Atlantic has a&nbsp;<a href="https://www.theatlantic.com/technology/archive/2017/01/trolling-by-distraction/514589/">readable summary</a>&nbsp;of recent research by&nbsp;Gary King, Jennifer Pan, and Margaret E. Roberts. They started with thousands of leaked Chinese government emails where commentators report on their work, which&nbsp;became the raw data for an accurate predictive model of which&nbsp;posts are&nbsp;government PR. A&nbsp;surprising twist: nearly 60% of paid commenters will just tell you they&#8217;re posting for the government when you ask them, which allowed these scholars to verify their country-wide model. But the core of the analysis is what these posters were doing.</p>
<p>From the <a href="http://gking.harvard.edu/50c">paper</a>:</p>
<blockquote><p>We estimate that the government fabricates and posts about 448 million social media comments a year. In contrast to prior claims, we show that the Chinese regime’s strategy is to avoid arguing with skeptics of the party and the government, and to not even discuss controversial issues. We infer that the goal of this massive secretive operation is instead to regularly distract the public and change the subject, as most of the these posts involve cheerleading for China, the revolutionary history of the Communist Party, or other symbols of the regime.</p></blockquote>
<p>And here&#8217;s the breakdown of what these posters were doing. &#8220;Cheerleading&#8221; dominates for every sample of government accounts. Arguments are rare.</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4291" src="http://jonathanstray.com/wp-content/uploads/2017/02/Screen-Shot-2017-02-24-at-2.52.26-PM.png" alt="Screen Shot 2017-02-24 at 2.52.26 PM" width="909" height="560" srcset="http://jonathanstray.com/wp-content/uploads/2017/02/Screen-Shot-2017-02-24-at-2.52.26-PM.png 909w, http://jonathanstray.com/wp-content/uploads/2017/02/Screen-Shot-2017-02-24-at-2.52.26-PM-300x185.png 300w, http://jonathanstray.com/wp-content/uploads/2017/02/Screen-Shot-2017-02-24-at-2.52.26-PM-768x473.png 768w" sizes="auto, (max-width: 909px) 100vw, 909px" /></p>
<p>Note that this is only one half of the Chinese&nbsp;media control strategy. There is still massive censorship of&nbsp;political expression, especially of <a href="http://gking.harvard.edu/publications/how-censorship-china-allows-government-criticism-silences-collective-expression">any post relating to organized protest</a>, which is empirically <a href="https://www.youtube.com/watch?v=YJSehRlU34w">good at toppling governments</a>.</p>
<p>All of this without ever getting into an argument.&nbsp;This suggests that there is actually no need to engage the critics/trolls to get your message out (though it might still be worthwhile to distract and monitor them.)&nbsp;Just communicate positive messages to the masses while you quietly disable your detractors. A&nbsp;counter-strategy, if you are facing this type of opponent, is organized, visible resistance. Get into the streets and make it impossible to talk about something else &#8212; though note that recent experiments suggest that <a href="https://papers.ssrn.com/sol3/papers2.cfm?abstract_id=2911177">violent or extreme protest tactics will backfire</a>.</p>
<p>But China has a tightly controlled media and the greatest censorship regime the world has ever seen. If you&#8217;re operating in a relatively free media environment, you have to manipulate the press instead.</p>
<p><strong>Milo: Attention by any means necessary</strong></p>
<p>The most insightful thing I have ever read about the wonder that was&nbsp;Milo Yiannopoulos comes from the man who wrote a <a href="https://en.wikipedia.org/wiki/Trust_Me,_I'm_Lying">book on manipulating the media</a>, documenting the strategies he devised to&nbsp;market&nbsp;people like Tucker Max.&nbsp;Ryan Holiday <a href="http://observer.com/2017/02/i-helped-create-the-milo-trolling-playbook-you-should-stop-playing-right-into-it/">writes</a>,</p>
<blockquote><p>We encouraged protests at colleges by sending outraged emails to various activist groups and clubs on campuses where the movie was being screened. We sent fake tips to Gawker, which dutifully ate them up. We created a boycott group on Facebook that acquired thousands of members. We made deliberately offensive ads and ran them on websites where they would be written about by controversy-loving reporters. After I began vandalizing some of our own billboards in Los Angeles, the trend spread across the country, with parties of feminists roving the streets of New York to deface them (with the <i>Village Voice</i> in tow).</p>
<p>But my favorite was the campaign in Chicago—the only major city where we could afford transit advertising. After placing a series of offensive ads on buses and the metro, from my office I alternated between calling in angry complaints to the Chicago CTA and sending angry emails to city officials with reporters cc’d, until ‘under pressure,’ they announced that they would be banning our advertisements and returning our money. Then we put out a press release denouncing this cowardly decision.</p>
<p>I’ve never seen so much publicity. It was madness.</p>
<p>. . .</p>
<p><strong>The key tactic of alternative or provocative figures is to leverage the size and platform of their “not-audience” (i.e. their haters in the mainstream) to attract attention and build an actual audience.</strong> Let’s say 9 out of 10 people who hear something Milo says will find it repulsive and juvenile. Because of that response rate, it’s going to be hard for someone like Milo to market himself through traditional channels. His potential audience is too spread out, and doesn’t have that much in common. He can’t advertise, he can’t find them one by one. It’s just not going to scale.</p>
<p>But let’s say he can acquire massive amounts of negative publicity by pissing off people in the media? Well now all of a sudden someone is absorbing the cost of this inefficient form of marketing for him.</p></blockquote>
<p>(Emphasis mine.) &nbsp;That one&#8217;s adversaries&nbsp;should be denied attention is not a new idea. Indeed, this is central to the &#8220;no-platforming&#8221; tactic. But no-platforming plays right into&nbsp;an outrage-based strategy&nbsp;if it results in additional&nbsp;attention&nbsp;(see also&nbsp;the <a href="https://en.wikipedia.org/wiki/Streisand_effect">Streisand effect</a>).&nbsp;Worse, all the incentives for media makers are wrong.&nbsp;It&#8217;s going to be very hard for journalists and other media figures to wean themselves off of outrage, because strong emotional reactions get people to share information&nbsp;(<a href="http://www.niemanlab.org/2015/05/when-disgusting-goes-viral-strong-negative-emotions-can-push-social-sharing-through-the-roof/">1</a>, <a href="http://journals.sagepub.com/doi/pdf/10.1177/109019810002700506">2</a>, <a href="https://blog.bufferapp.com/viral-content-emotions-ages-genders">3</a>, etc.) and information sharing has become the&nbsp;basis of distribution, which is the basis of revenue. We are in dire need of&nbsp;<a href="https://medium.com/@SeanBlanda/medium-and-the-reason-you-cant-stand-the-news-anymore-c98068fec3f8">new business models for news</a>.</p>
<p>But&nbsp;this breakdown of the mechanics of outrage marketing does suggest a counter-strategy: before you get mad, or report on someone getting mad, do your homework. Holiday called to&nbsp;complain about&nbsp;his own content, put out false&nbsp;press releases, etc. A smart journalist&nbsp;might be able to uncover&nbsp;this deception. In a propaganda war, all journalists should be investigative journalists.</p>
<p>Attention is the currency of networked propaganda. Attention is the key. Be very careful who you give it to, and understand how your own emotions and incentives can be exploited.</p>
<p>[tweet id=&#8221;819748035945082881&#8243; hide_thread=&#8217;true&#8217; align=&#8217;center&#8217;]</p>
<p>But even if you&#8217;ve uncovered a deception,&nbsp;it&#8217;s not enough to say that someone else is lying. You have to tell a different story.</p>
<p><strong>Debunking doesn&#8217;t work:&nbsp;provide an alternative narrative</strong></p>
<p>Telling people that something they&#8217;ve heard is wrong may be&nbsp;one of the most pointless things you can do. A long series of experiments shows that it rarely changes belief. Brendan Nyhan is one of the main&nbsp;scholars here, with a series of papers on political misinformation. This is about&nbsp;human psychology; we simply don&#8217;t process information rationally, but instead employ a variety of heuristics and cognitive shortcuts (not necessarily maladaptive in general)&nbsp;that can be exploited. The classic experiment <a href="http://www.dartmouth.edu/~nyhan/nyhan-reifler-causal-corrections.pdf">goes like this</a>:</p>
<blockquote><p>Participants in a study within this paradigm are told that there was a fire in a warehouse and that there were flammable chemicals in the warehouse that were improperly stored. When hearing these pieces of information in succession, people typically make a causal link between the two facts and infer that the fire was caused in some way by the flammable chemicals. Some subjects are then told that there were no flammable chemicals in the warehouse. Subjects who have received this corrective information may correctly answer that there were no flammable chemicals in the warehouse <em>and</em> separately incorrectly answer that flammable chemicals caused the fire. This seeming contradiction can be explained by the fact that people update the factual information about the presence of flammable chemicals without also updating the causal inferences that followed from the incorrect information they initially received.</p></blockquote>
<p>Worse, repeating a lie in the process of refuting it may actually&nbsp;reinforce it! The counter strategy is to replace&nbsp;one narrative with another. <a href="http://archives.cjr.org/behind_the_news/the_backfire_effect.php">Affirm, don&#8217;t deny</a>:</p>
<blockquote><p>Which of these headlines strikes you as the most persuasive:</p>
<p><strong>“I am not a Muslim, Obama says.”</strong></p>
<p><strong>“I am a Christian, Obama says.”</strong></p>
<p>The first headline is a direct and unequivocal denial of a piece of misinformation that’s had a frustratingly long life. It’s Obama directly addressing the falsehood.</p>
<p>The second option takes a different approach by affirming Obama’s true religion, rather than denying the incorrect one. He’s asserting, not correcting.</p>
<p>Which one is better at convincing people of Obama’s religion? According to recent research into political misinformation, it’s likely the latter.</p></blockquote>
<p><strong>The role of intelligence: Action not reaction</strong></p>
<p>Let&#8217;s return to China for a moment. Here&#8217;s a chart, from the paper above, on the number of government social media postings over time:</p>
<p><img loading="lazy" decoding="async" class="aligncenter size-full wp-image-4301" src="http://jonathanstray.com/wp-content/uploads/2017/02/Screen-Shot-2017-02-24-at-4.29.32-PM.png" alt="Screen Shot 2017-02-24 at 4.29.32 PM" width="730" height="461" srcset="http://jonathanstray.com/wp-content/uploads/2017/02/Screen-Shot-2017-02-24-at-4.29.32-PM.png 730w, http://jonathanstray.com/wp-content/uploads/2017/02/Screen-Shot-2017-02-24-at-4.29.32-PM-300x189.png 300w" sizes="auto, (max-width: 730px) 100vw, 730px" /></p>
<p>Posts spiked around political events (CCP Congress) and emergencies that the government would rather citizens not talk about, such as riots and a rail explosion. This &#8220;cheerleading&#8221; propaganda wasn&#8217;t simply a regular diet of good news, but a precisely controlled strategy designed to drown out undesirable narratives.</p>
<p>One of the problems of a free press is that &#8220;the media&#8221; is a herd of cats. There really is no central authority &#8212; independence and diversity, huzzah! Similarly, distributed protest movements like Anonymous can be very effective for certain types of activities. But even Anonymous had&nbsp;<a href="https://www.wired.com/2012/07/ff_anonymous/">central figures planning operations</a>.</p>
<p>The most successful propagandists, like the most successful protest movements, are very&nbsp;organized. (Lost in the current &#8220;diversity of tactics&#8221; rhetoric is the historical fact that key battles in the&nbsp;civil rights movement were&nbsp;<a href="http://patrickmurfin.blogspot.com/2016/02/nashville-lunch-counter-sit-ins-raised.html">carefully planned</a>.) Organization and planning requires intelligence. You have to know who your adversaries&nbsp;are and what they are doing. Intelligence involves basic steps like:</p>
<ul>
<li>Pay attention to the details&nbsp;of every encounter. Who wrote that story or posted that comment?</li>
<li>Research the actors and their networks. Who&nbsp;are they connected to? What communication channels do they use to coordinate? Who directs operations?</li>
<li>Real-time monitoring. When a misinformation campaign begins, you need to get to your audience before they do (with something more than just a debunk, as above.)</li>
</ul>
<p>Although there may be useful <a href="https://medium.com/@d1gi/the-election2016-micro-propaganda-machine-383449cc1fba">technological approaches to tracing networks</a>, there is no magic here; anyone can keep a spreadsheet&nbsp;of actors, you can do real-time monitoring with little more than Tweetdeck, and investigative journalists already know how to investigate. But centralization may be important. The Russian&nbsp;approach of &#8220;many messages, many channels&#8221; suggests that an&nbsp;open, diverse network can&nbsp;succeed at&nbsp;individual propaganda actions, and I bet it would succeed at counter-propaganda actions too. But intelligence is different, and it&#8217;s&nbsp;an unanswered&nbsp;question whether the messy collection of journalists, NGOs, universities, and activists in a free society can&nbsp;do effective counter-propaganda intelligence, or even agree sufficiently on what that would be. I don&#8217;t think a distributed approach&nbsp;will work here; someone needs to own the database and run the show.</p>
<p class="graf graf--p">Update: The <a class="markup--anchor markup--p-anchor" href="https://eeas.europa.eu/headquarters/headquarters-homepage_en/2116/%20Questions%20and%20Answers%20about%20the%20East%20StratCom%20Task%20Force" target="_blank" rel="noopener noreferrer" data-href="https://eeas.europa.eu/headquarters/headquarters-homepage_en/2116/%20Questions%20and%20Answers%20about%20the%20East%20StratCom%20Task%20Force">East StratCom Task Force</a> seems to be exactly this sort of centralized actor for the EU.</p>
<p>But one way or another, you have know what your&nbsp;propagandist adversary is doing, in detail and in real-time.&nbsp;If you don&#8217;t have that critical function taken care of, you&#8217;re going to be forever reactive, which means you&#8217;re probably&nbsp;going to lose.</p>
<p><strong>PS: Up your security game</strong></p>
<p>Hacking and leaking &#8212; which is one of the more effective ways&nbsp;to <a href="https://en.wikipedia.org/wiki/Doxing">dox</a>&nbsp;someone &#8212; &nbsp;has become a propaganda tactic. If you don&#8217;t want to be on the wrong end of&nbsp;this, I recommend immediately doing the following easy things:</p>
<ul>
<li>Enable 2-step logins on your email and other important&nbsp;accounts.</li>
<li>Learn to recognize&nbsp;phishing.</li>
</ul>
<p>I suspect this would prevent 70%-90% of hacking and doxxing attempts. It <a href="http://www.cbsnews.com/news/the-phishing-email-that-hacked-the-account-of-john-podesta/">would have&nbsp;saved</a> John Podesta.&nbsp;Here&#8217;s <a href="https://source.opennews.org/guides/defending-accounts/">lots more on easy ways to protect yourself.</a></p>
<p>Stay safe out there, and good luck.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/networked-propaganda-and-counter-propaganda/feed</wfw:commentRss>
			<slash:comments>41</slash:comments>
		
		
			</item>
		<item>
		<title>What do Journalists do with Documents?</title>
		<link>http://jonathanstray.com/what-do-journalists-do-with-documents</link>
					<comments>http://jonathanstray.com/what-do-journalists-do-with-documents#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Wed, 02 Nov 2016 14:46:27 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4273</guid>

					<description><![CDATA[Many people have realized&#160;that natural language processing (NLP) techniques could be extraordinarily helpful to journalists who need to deal with large volumes of documents or other text data. But although there have been many experiments and much speculation, almost no one has built NLP&#160;tools that journalists actually&#160;use. In part, this is because computer scientists haven&#8217;t &#8230; <a href="http://jonathanstray.com/what-do-journalists-do-with-documents" class="more-link">Continue reading <span class="screen-reader-text">What do Journalists do with Documents?</span></a>]]></description>
										<content:encoded><![CDATA[<p>Many people have realized&nbsp;that natural language processing (NLP) techniques could be extraordinarily helpful to journalists who need to deal with large volumes of documents or other text data. But although there have been many experiments and much speculation, almost no one has built NLP&nbsp;tools that journalists actually&nbsp;use. In part, this is because computer scientists haven&#8217;t had a good description of the problems journalists actually face. This talk and <a href="http://journalism.stanford.edu/cj2016/files/What%20do%20journalists%20do%20with%20documents.pdf">paper</a>, presented at the&nbsp;<a href="http://journalism.stanford.edu/cj2016/">Computation + Journalism Symposium</a>, are one&nbsp;attempt to remedy that. (Talk slides <a href="https://www.scribd.com/presentation/329761307/What-Do-Journalists-Do-With-Documents-Field-Notes-for-NLP-Researchers">here</a>.)</p>
<p><iframe loading="lazy" title="C+J 2016: Documents, Data Mining and Discovery" width="660" height="371" src="https://www.youtube.com/embed/6fLZCjdat_0?start=100&#038;feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<p>This all comes out of my experience both building and using <a href="http://overviewdocs.com">Overview</a>, an open source document mining system built specifically for investigative journalists. The <a href="http://journalism.stanford.edu/cj2016/files/What%20do%20journalists%20do%20with%20documents.pdf">paper</a>&nbsp;summarizes every story completed with Overview,&nbsp;and also discusses the five cases I know where journalists used custom NLP code to get the story done.</p>
<p><span id="more-4273"></span></p>
<p><img loading="lazy" decoding="async" class="size-full wp-image-4274 alignnone" src="http://jonathanstray.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-02-at-10.45.22-AM.png" alt="Stories done with Overview" width="823" height="626" srcset="http://jonathanstray.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-02-at-10.45.22-AM.png 823w, http://jonathanstray.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-02-at-10.45.22-AM-300x228.png 300w, http://jonathanstray.com/wp-content/uploads/2016/11/Screen-Shot-2016-11-02-at-10.45.22-AM-768x584.png 768w" sizes="auto, (max-width: 823px) 100vw, 823px" /></p>
<p><span style="font-size: inherit;">The talk is more focussed on the lessons learned &#8212; all the things I wish I had known when I started writing NLP code for journalism six years ago. I recommend six research themes for computer scientists who want to help journalists:</span></p>
<p><strong>Robust import.</strong> Preparing documents for analysis is a much bigger problem than is generally appreciated. Even structured data like email is often delivered on paper.</p>
<p><strong>Robust analysis</strong>. Journalists routinely deal with unbelievably dirty documents. OCR error confounds classic algorithms. Shorthand and jargon break dictionaries and parsers.</p>
<p><strong>Search, not exploration</strong>. Reporters are usually looking for something, but it may not be something that is easy to express in a keyword search. The ultimate example is “corruption,” which you can&#8217;t just type into a search box.</p>
<p><strong>Quantitative summaries</strong>. Journalists have long produced stories by counting the number of documents of a certain type. How can we make this easy, flexible, and accurate?</p>
<p><strong>Interactive methods</strong>. Even with NLP, document-based reporting requires extensive human reading. How do we best integrate machine and human intelligence in an interactive loop?</p>
<p><strong>Clarity and Accuracy</strong>. Journalists are accountable to the public for their results. They must be able to explain how they got their answer, and how they know the answer is right.</p>
<p>I am currently compiling test sets&nbsp;of&nbsp;real-world documents that journalists have encountered, to help researchers who want to work on these problems. Contact me if you&#8217;re interested! I&#8217;d also like to take this opportunity to point out that Overview has an analysis <a href="https://github.com/overview/overview-server/wiki/Overview-API-Overview">plugin API</a>, so if you&#8217;re doing work that you want journalists to use, this is one easy way to get a UI around it, and&nbsp;get it shipping with a&nbsp;widely-used tool.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/what-do-journalists-do-with-documents/feed</wfw:commentRss>
			<slash:comments>6</slash:comments>
		
		
			</item>
		<item>
		<title>The Dark Clouds of Financial Cryptography</title>
		<link>http://jonathanstray.com/the-dark-clouds-of-financial-cryptograpy</link>
					<comments>http://jonathanstray.com/the-dark-clouds-of-financial-cryptograpy#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Tue, 11 Oct 2016 17:24:10 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4207</guid>

					<description><![CDATA[I feel we&#8217;re on the precipice of some delightfully weird and possibly very alarming developments at the intersection of code and money.  There is something deep in the rules that is getting rewritten, only we can&#8217;t quite see how yet. I&#8217;ve had this feeling before, as a self-described Cypherpunk in the 1990s. We knew or hoped &#8230; <a href="http://jonathanstray.com/the-dark-clouds-of-financial-cryptograpy" class="more-link">Continue reading <span class="screen-reader-text">The Dark Clouds of Financial Cryptography</span></a>]]></description>
										<content:encoded><![CDATA[<p>I feel we&#8217;re on the precipice of some delightfully weird and possibly very alarming developments at the intersection of code and money.  There is something deep in the rules that is getting rewritten, only we can&#8217;t quite see how yet. I&#8217;ve had this feeling before, as a self-described <a href="https://en.wikipedia.org/wiki/Cypherpunk">Cypherpunk</a> in the 1990s. We knew or hoped that encrypted communication would change global politics, but we didn&#8217;t quite know how yet. And then Wikileaks happened. As Bruce Sterling <a href="http://web.archive.org/web/20101225022507/http://www.webstock.org.nz/blog/2010/the-blast-shack">wrote at the time</a>,</p>
<blockquote><p>At last — at long last — the homemade nitroglycerin in the old cypherpunks blast shack has gone off.</p></blockquote>
<p>That was exactly how I felt when that first SIGACT dump hit the net, by then a newly hired editor at the Associated Press. Now I&#8217;m studying finance, and I can&#8217;t shake the feeling that cryptocurrencies &#8212; and their abstracted cousins, &#8220;smart contracts&#8221; and other computational financial instruments &#8212; are another explosion of weirdness waiting to happen.</p>
<p>I&#8217;m hardly alone in this. Lots of technologists think the &#8220;block chain&#8221; pioneered by bitcoin is going to be consequential. But I think they think this for the wrong reasons. Bitcoin itself is never going to replace our current system of money transfer and clearing; it&#8217;s much slower than existing payment systems, often more expensive, uses far too much energy, and don&#8217;t scale well. Rather, bitcoin is just a taste, a hint: it shows that we can mix computers and money in surprising and consequential ways. And there are more ominous portents, such as contracts that are actually code and the very first &#8220;distributed autonomous organizations.&#8221; But we&#8217;ll get to that.</p>
<p>What is clear is that we are turning capitalism into code &#8212; trading systems, economic policy, financial instruments, even money itself &#8212; and this is going to change a lot of things.<span id="more-4207"></span></p>
<p>The question I always come to is this: what do we want our money to do? Code is also policy, because it constrains what people can and cannot do, and monetary code is economic policy. But code is not <em>all</em> powerful, which is where the bitcoin techno-libertarian ethos goes wrong. What I&#8217;ve learned since my Cypherpunk days is that we need to decide now what happens when the code fails, because eventually there will be a situation that will have to be resolved by law and politics. We should design for this rather than trying to avoid it. And this time around, there&#8217;s an even weirder twist: when we start describing financial contracts in code, we lose the ability to predict what they&#8217;ll do!</p>
<p><strong>What does bitcoin get you anyway?</strong></p>
<p>We&#8217;ve had electronic cash since well before I was born. We use it every day: bank balances, credit cards, and all the rest. Here are some things that these systems do:</p>
<ul>
<li>Transfer money without anything physical changing hands.</li>
<li>Security. It&#8217;s not possible to take back spent money unilaterally, or spend the same money twice.</li>
<li>Controlled money supply. You can&#8217;t mint your own.</li>
</ul>
<p>These are the new features that bitcoin adds:</p>
<ul>
<li>Pseudo-anonymity. Parties to a transaction are identified only by a <a href="https://en.wikipedia.org/wiki/Public-key_cryptography">public key</a>.</li>
<li>A public ledger of all transactions that provides cryptographic proof of ownership. This is the &#8220;block chain.&#8221;</li>
<li>Decentralization. The security of the system does not depend on the honesty of any single authority, but only honest action by the majority of nodes.</li>
</ul>
<p>This is private secure global digital money without governments or banks, and you never need to trust in the honesty and competence of any one institution! It&#8217;s a really neat trick, exactly the sort of magic that first drew me to cryptography. You could learn how the trick is done places like <a href="https://www.youtube.com/watch?v=fOMVZXLjKYo">here</a>, but part of the trick is that it&#8217;s not just cryptography. It&#8217;s also clever alignment of incentives. It&#8217;s <em>financial cryptography</em>.</p>
<p>Here&#8217;s the core innovation: it is possible to use your computer to &#8220;mine&#8221; bitcoin &#8212; that is, create new money for yourself &#8212; and this mining operation simultaneously maintains the integrity of the global distributed ledger. This is a profound thing. It means that the distributed network operators (bitcoin &#8220;nodes&#8221;) get paid, and indeed bitcoin miners collectively made something like <a href="https://blockchain.info/charts/market-cap?timespan=1year">six billion dollars</a> in the last year. It also means that control of the money supply is distributed, which makes it very unlike central bank money. This is the first place that the politics gets weird.</p>
<p><strong>Control of the money supply</strong></p>
<p>If you&#8217;re a government, you want to control your money. Traditionally, central banks do this to balance economic outcomes like unemployment and inflation. They&#8217;ve also created money for more drastic and often disreputable purposes like funding wars, inflating away debts or influencing the balance of trade. There&#8217;s a lot of destructive stuff you can do with the power to print money, which is one reason why states guard their monopoly closely. There are laws against counterfeiting.</p>
<p>But in the bitcoin scheme of things, money is created by anyone who can solve a specific type of computational puzzle. More specifically, you have to <a href="http://security.stackexchange.com/questions/11717/why-are-hash-functions-one-way-if-i-know-the-algorithm-why-cant-i-calculate-t">invert a hash function</a>, a problem that can only really be solved by brute force guessing &#8212; a massive amount of guessing, something like <a href="https://www.quora.com/How-much-CPU-time-is-needed-to-mine-1-bitcoin">400 years</a> on a standard PC. In other words, you pay for freshly minted bitcoins with computer time, an extremely capital and <a href="http://motherboard.vice.com/read/bitcoin-could-consume-as-much-electricity-as-denmark-by-2020">energy intensive</a> process. This is in no way challenges the primacy of accumulated wealth; it&#8217;s a fundamentally conservative amendment to capitalism.</p>
<p>The whole point of this is to put an inviolate limit on how fast new coin can be created. You need a <em>lot</em> of resources to mine a little bitcoin &#8212; just like mining gold. In fact, the protocol automatically adjusts the difficulty of the hash problem so that new coins always get created at about the same rate, which means blocks are added to the chain at a constant rate, about ten minutes per block, no matter how many computers people throw at the problem, or how fast our computers get. And today, the bitcoin mining industry uses data centers full of custom chips that collectively <a href="http://jasondrowley.com/2015/12/04/the-bitcoin-network-is-11000x-faster-than-the-top-500-supercomputers-combined/">dwarf the largest supercomputers</a>. All doing essentially nothing except being expensive, which turns out to be a foolproof method of trust-less distributed control.</p>
<p>Sometimes a little trust gets you a lot, like a stable money supply without using as much electricity as a <a href="http://motherboard.vice.com/read/bitcoin-could-consume-as-much-electricity-as-denmark-by-2020">small country</a>. Using trust as a design element is a hard concept for hard-core cryptographers, whose protocols are suspicious by design. But of course finance has always run on trust; there would be no credit without it, and there&#8217;s no credit in bitcoin either. No one ever has a negative balance, or even a balance at all, just ownership of tokens.</p>
<p>For the moment, mining is a profitable business and both the <a href="https://blockchain.info/charts/hash-rate">quantity of mining</a> and the <a href="https://blockchain.info/charts/market-price">price of bitcoin</a> are increasing. Which is good news for bitcoin users, because the work of mining is also the work of keeping the transaction processing network running; that&#8217;s why anyone bothers to process your bitcoin payments. That&#8217;s the sort of incentive engineering you get to do when money and code mix.</p>
<p>So the whole system is releasing new coins at a more or less constant rate, no one can speed it up no matter how much they spend, and it would be impossible to stop it without shutting computers down all over the world. Given bitcoin&#8217;s libertarian leanings, perhaps it&#8217;s not surprising that this is very much in line with Milton Friedman&#8217;s theory that a <a href="https://en.wikipedia.org/wiki/Friedman%27s_k-percent_rule">steady percentage increase</a> in the money supply is the best policy. Then again, a constant coin mining rate also means a constant transaction processing rate, so perhaps this is merely a convenient choice for a payments system.</p>
<p>Either way, this arrangement is economic policy written in code. If the whole world ran on a bitcoin, there would be no way to manage recessions &#8212; for example to increse employment &#8212; by adjusting the money supply</p>
<p><strong>The geopolitics of the block chain</strong></p>
<p>All cryptograpy has politics, and bitcoin is no exception. It appeals particularly to a certain sort of techno-libertarian: why should the banks say what is money and when we can trade it? Why should they make all of our financial privacy decisions for us? And why should we have to trust any one person with our money?</p>
<p>But then again, these may not be particularly motivating problems for most people. Although a wide variety of merchants will now accept bitcoin for a wide variety of goods and services, like cash it&#8217;s well suited for shady deals &#8212; especially given its global and anonymous nature. It&#8217;s impossible to say for sure,  because that&#8217;s what anonymity is, but gray markets are likely the predominant use. But we do know that 70% of global trading volume and more than 50% of mining also <a href="http://www.coindesk.com/bitcoin-in-china-an-insiders-view/">occurs in China</a>. This may be nothing more than peer-to-peer commerce, or it may indicate that bitcoin is at the center of a Renminbi-denominated <a href="https://en.wikipedia.org/wiki/Hawala">halawa</a> network of underground money transfers.</p>
<p>China, and other governments, have unsurprisingly taken steps to discourage bitcoin use, and bitcoin is now <a href="https://www.cryptocoinsnews.com/top-10-countries-bitcoin-banned/">restricted or officially banned</a> in many countries. There are potentially good reasons for this, such as the ability to prevent terrorist financing and money laundering, just as the international financial system has implemented <a href="http://www.wsj.com/articles/new-york-banking-regulator-to-publish-new-rules-to-prevent-money-laundering-1467244800">progressively tighter controls</a>. There are also potentially bad reasons to restrict bitcoin, depending on your politics: state mismanagement of the money supply, protections for incumbent banks, pernicious regulation of capital flows, or authoritarian surveillance of commerce.</p>
<p>But if you have an uncensored internet connection and the right software, no one can stop you from trading in bitcoin. Once again, the network proves to be a great equalizer between citizens and states. The Cypherpunks understood very early on that encrypted communication enabled uncensorable distributed coordination, and that this would challenge the power of states. But cryptographic money promises something even more revolutionary: state-free trade, economically significant transfers of cold hard currency. It&#8217;s a much bigger hammer.</p>
<p>What we didn&#8217;t think carefully enough about, back then, was who would be using these tools. Encrypted communication has supported the toppling of autocratic regimes, but it also supports terrorism. Bitcoin miners, too, might have diverse goals.</p>
<p>The cryptographic consensus algorithm currently in use by every bitcoin node dictates that the majority defines which transactions get added to the global ledger and hence validated. Which means that Chinese miners now effectively control bitcoin. In principle, all Chinese operators could collude to allow double spending of their coins. Or they could &#8220;<a href="http://www.coindesk.com/preparing-bitcoin-hard-fork/">hard fork</a>&#8221; the protocol at any moment simply by adopting a new standard. Everyone else would have to go along, or their existing bitcoins would be worthless.</p>
<p>Thus the bitcoin protocol is already the subject of international diplomacy, as when American entrepreneurs <a href="http://www.nytimes.com/2016/07/03/business/dealbook/bitcoin-china.html">visited China to lobby</a> for capacity-enhancing changes (they failed). Running a specific version of the bitcoin software and maintaining a specific version of the ledger data is in effect a vote. However, this hasn&#8217;t prevented vigorous arguments and campaigns about how those votes should be cast.</p>
<p>Meanwhile the &#8220;bitcoin core&#8221; developers also have substantial but not absolute influence, as they maintain the standard open source implementation of the protocol. They can&#8217;t <em>make</em> anyone go along with changes, but it sure could be inconvenient if you didn&#8217;t want to. And what happens if they don&#8217;t all agree?</p>
<p><strong>From cryptocurrency to </strong><b>crypto-contracts</b></p>
<p>The cryptographic innovations of bitcoin are public and easily copied, and profitable if you get in first on a successful new currency. So naturally there has been a <a href="https://en.wikipedia.org/wiki/List_of_cryptocurrencies">dizzying array of &#8220;altcoin&#8221; implementations</a> with varying degrees of adoption and stability. The most interesting altcoins add new features, such as extended capacity or new transaction types.</p>
<p>But there&#8217;s one altcoin that does something truly new and interesting: Ethereum allows software-defined transactions. That is: a transaction can <a href="https://github.com/ethereum/wiki/wiki/White-Paper">contain code</a> which executes to determine who gets paid what, or more generally to perform any computation and store the results in the public ledger (block chain). The Ethereum Foundation, a Swiss non-profit, <a href="https://www.ethereum.org/">says</a> that Ethereum is a &#8220;decentralized platform that runs smart contracts: applications that run exactly as programmed without any possibility of downtime, censorship, fraud or third party interference.&#8221;</p>
<p>This is science-fiction stuff. First computational contracts, then AI lawyers, all executing on the open source Justice operating system&#8230; We&#8217;re not quite there yet, but Ethereum is the proof of concept. Like bitcoin, it extrapolates legitimately interesting technical innovation into a soaring anti-authoritarian dream. A &#8220;smart contract&#8221; is a financial contract defined by code. You cryptographically sign onto it, perhaps by making a payment, and then the contract then executes on the network, does its calculations, and ultimately makes payouts. As long as the majority of the Ethereum network is operating honestly, you get paid exactly what the code says you will get paid; neither the seller or anyone else can alter the terms after the fact. No courts are needed to enforce the terms, no intermediaries are involved, no trust is required.</p>
<p>If bitcoin is state-free money, smart contracts are state-free financial instruments that are fully transparent and make fraud impossible. Except no, of course not, just like encryption didn&#8217;t make anonymity easy, and for the same reason: there are systems outside the computer.</p>
<p><strong>Cryptocurrencies are made of people</strong></p>
<p>In one sense Ethereum&#8217;s libertarian promise is all true: just as bitcoin nodes validate transactions by consensus, all Ethereum nodes collectively enforce the code-as-contract guarantee. In another sense it&#8217;s completely bogus: the computers are still controlled by people, as a significant hack demonstrated.</p>
<p>The story goes like this: the Ethereum community crowd-funded an initial investment of $150 million dollars to seed a &#8220;distributed autonomous organization,&#8221; or DAO. This was one of the core <a href="https://medium.com/@BlockChannel/what-is-a-dao-how-do-they-benefit-consumers-f7a0a862f3dc#.f9da7uy2k">visions</a> that excited Ethereum proponents, and a DAO is probably the most cyberpunk entity of all time. As CoinDesk <a href="http://www.coindesk.com/the-dao-just-raised-50-million-but-what-is-it/">described it</a>:</p>
<blockquote><p>It&#8217;s likely best to think of The DAO — which is sometimes also referred to as The DAO Hub — as a tightly packed collection of smart contracts written on the Ethereum blockchain.</p>
<p>Taken collectively, the smart contracts amount to a series of by-laws and other founding documents that determine how its constituency — anyone around the world who has bought DAO tokens with ethers — votes on decisions, allocates resources and in theory, creates a wide-range of possible returns.</p>
<p>Unlike a traditional company that has a designated managerial structure, The DAO operates through collective voting, and is owned by everyone who&#8217;s purchased a DAO token. On top of that structure is a group of so-called Curators that can be elected or removed by DAO token holders.</p></blockquote>
<p>Got that? It was a fund where the choice of investments, the election of officers, and other such matters were all done by submitting votes as transactions on the Ethereum block chain, to be interpreted by code previously placed there. And just to make it even more like a William Gibson novel,  nobody knew exactly who created this entity! Of course there was an Ethereum address attached to code that created the DAO, but Ethereum addresses are anonymous.</p>
<p>And then it was hacked. Maybe. Depending on your point of view. What actually happened is someone found and exploited a subtle bug in the DAO&#8217;s code and caused it to pay them the equivalent of $60 million to their Ethereum account.</p>
<p>Software is a subtle thing, and it&#8217;s extremely difficult to write bug-free code on the first go. It&#8217;s even harder to write code that will stand up against a malicious attacker who stands to make a life-altering amount of money if they break your system. In the event, the bug involved a <a href="http://subtle bug">problem with re-entrancy</a> in the payout function, for which the proposed solution was to guard your disbursement code with mutexes. If you&#8217;re not a computer scientist, this is just technical detail. If you are a computer scientist, your skin is crawling. Long experience has shown that correct reasoning about these types of problems is <a href="http://blog.smartbear.com/programming/why-johnny-cant-write-multithreaded-programs/">nearly impossible for mere mortals</a>. If smart contracts require super-human intelligence to prevent fraud, we&#8217;re in trouble.</p>
<p>What happened next is even more interesting. The human-language contract explaining the terms of buying into the DAO explicitly stated that the code was the final legal word. So perhaps the DAO code was buggy, but <em>caveat emptor</em>, the hacker played by the rules of the game and got paid. <a href="https://www.bloomberg.com/view/articles/2016-06-17/blockchain-company-s-smart-contracts-were-dumb">Maybe they weren&#8217;t even a hacker</a>, but merely a savvy investor who understood a little-known clause in the contract. If the code is law, then whatever the code allows is legal by definition. Ultimately, the morality of this move is a question outside of the code itself. And that&#8217;s the problem.</p>
<p>The majority of people involved in Ethereum felt that investors should get their money back. But a sizable minority disagreed &#8212; they truly believed in this &#8220;code as law&#8221; model. And so both the community and the block chain split: there was a hard fork. To this day, <a href="http://www.coindesk.com/ethereum-classic-explained-blockchain/">there are two parallel Ethereum ledgers</a>. In one world, the DAO hack was reversed. In the other universe, now called Ethereum Classic, the hacker got to keep their money.</p>
<p>Real financial contracts have lawyers and courts and precedents that provide a procedure for resolving disputes, and give investors reasonable safeguards. Discarding those institutional frameworks has a cost.</p>
<p><strong>Turing&#8217;s Demons</strong></p>
<p>Computer code can do arbitrarily subtle and weird things. This is a deep property of computation that we&#8217;ve known about even before the first electronic computers were actually built. Once a programming system reaches a minimal threshold of complexity, known as <a href="https://en.wikipedia.org/wiki/Turing_completeness">Turing completeness</a>, there are a set of inter-related theorems that say, basically, you will never be able to tell what a program does without actually running it. It follows that it will <em>always</em> be possible to <a href="https://www.reddit.com/r/btc/comments/4p0gq3/why_turingcomplete_smart_contracts_are_doomed/">hide something malicious in financial code</a>. If code is law, you&#8217;re going to get scammed. Legally.</p>
<p>One solution is to avoid general purpose code. There are strong parallels to <a href="http://www.upstandinghackers.com/langsec">recent computer security research</a> that argues that all user inputs to system need be limited to very restricted, non-programmable languages. It&#8217;s just impossible to secure arbitrary code. And indeed, Wall Street already has <a href="http://dslfin.org/resources.html">purpose-specific languages</a> for specifying financial contracts (such as derivatives) without invoking the disturbing power of general computation.</p>
<p>Turing completeness is a gateway to the dark powers. It freaks me out to imagine traders submitting contracts written in code to an exchange. It&#8217;s already tricky to <a href="https://www.propublica.org/special/interactive-cdos-interlocking-ownership">untangle the web</a> of counter-parties, derivatives, and legal triggers that can lead to cascading crashes in the financial system &#8212; just wait until we throw code in there.</p>
<p>But we&#8217;re not going to able to avoid all code. Even if traders aren&#8217;t allowed to use it to create new contracts, we need it for infrastructure. Every stock market, every financial exchange has code, and algorithmic trading is an entire industry. An increasing fraction of global transactions are handled by computers without any human review or intervention. This has led to weird behavior such as flash crashes &#8212; which are <a href="http://www.bloomberg.com/news/articles/2015-07-13/here-s-what-we-learned-from-the-official-report-on-the-flash-crash-in-u-s-treasuries">still unexplained</a>, even in very simple, usually very stable markets like US Treasury securities. There isn&#8217;t even a single master audit record of every trade made, and there <a href="https://corpgov.law.harvard.edu/2016/07/16/consolidated-audit-trail-the-cats-out-of-the-bag/">won&#8217;t be for years</a>.</p>
<p>It gets even weirder when you add incentivized humans to the mix: financial players are going to exploit every edge case they can find. There&#8217;s a passage from Michael Lewis&#8217; <em>Flash Boys</em> which describes the difficulty in setting up an exchange that can&#8217;t be gamed:</p>
<blockquote><p>Creating a new stock exchange is a bit like creating a casino: Its creator needs to ensure that the casino cannot in some way be exploitable by the patrons. Or, at worst, he needs to know exactly how his system might be exploited, so that he might monitor the exploitation— as a casino monitors card counting at the blackjack tables. “You are designing a system,” said Puz, “and you don’t want the system to be gameable.” &#8230; From the point of view of the most sophisticated traders, the stock market wasn’t a mechanism for channeling capital to productive enterprise but a puzzle to be solved.</p></blockquote>
<p>The designers of this new exchange, now known as IEX, spent months studying every type of order that could be submitted to other stock markets, and how these were exploited to rip off productive investors to the benefit of high-frequency traders (HFT). This is of course a moral judgement, and a judgment about what type of investor to privilege &#8212; and there are <a href="http://tabbforum.com/opinions/the-iex-neverendum-is-iexs-exchange-application-a-referendum-on-market-structure">massive ongoing arguments</a> about whether the current market structure that allows HFT is &#8220;fair.&#8221; But even if you know what you want your code to do, there&#8217;s no guarantee you&#8217;re going to get it. IEX found it incredibly difficult to avoid loopholes that could advantage high-frequency traders.</p>
<p>We are now, today, in our lifetimes, undertaking the process of turning capitalism into code. The code running our markets determines, literally, what is possible and who gets paid. Already, the cutting-edge of finance is basically nothing like &#8220;investing&#8221; as we usually think of it. It&#8217;s far more like hacking: find the properties of a complex system that get you the most money. Anything the exchange lets you do is legal, more or less. There are laws against market &#8220;manipulation&#8221; such as <a href="http://www.bloomberg.com/graphics/2015-spoofing/">spoofing</a>, but these terms are poorly defined ideas of fairness that don&#8217;t have simple technical definitions. Anyway, that&#8217;s only a problem if lawyers and regulators get involved. The code allows it.</p>
<p>I want our financial markets to be stable, transparent and fair. I want them to reward something other than the clever manipulation of an abstract system. And so I would argue for extreme simplicity in our electronic markets. Even very simple rules can spiral into complex consequences. Chess has more complex rules then Go, but it took computers 20 years longer to beat humans at Go. Recent game-theoretic work on algorithmic trading suggests that it&#8217;s going to be <a href="https://arxiv.org/pdf/1202.1448.pdf">very hard to stabilize</a> even very simple programs interacting with each other and with greedy humans.</p>
<p><strong>Politics always wins in the end</strong></p>
<p>Bitcoin and Ethereum are a kind of counter-power to established systems of money and finance. In the sense that many things are wrong with the current system and the powers-that-be are very hard to challenge, this is exciting. But the mistake is to think that code is enough. Wikileaks was premised on using cryptographic anonymization to protect their sources, but then Manning <a href="https://www.wired.com/2010/06/wikileaks-chat/">confessed</a> to a freelance journalist. And all the encryption in the world could not protect Snowden from the NSA&#8217;s long reach; that required the cooperation of the Russian government.</p>
<p>The modern, automated stock market has already been gamed. In April 2016, an individual from Pakistan <a href="http://blog.themistrading.com/2016/05/the-secs-edgar-system-needs-a-speed-bump/">uploaded a fake document</a> to the SEC&#8217;s EDGAR website, where public companies post their legally-required disclosures. Automated bots read the document and immediately traded on the false information, moving the stock price. The &#8220;hacker&#8221; made $425,000 in a matter of minutes, before anyone realized what was going on.</p>
<p>The Pakistan case was straightforward fraud, but it&#8217;s only going to get weirder. I have the Cypherpunk premonition again. Crypto-contracts shift the balance of power, and once again, a small group of people &#8212; this time, financial cryptographers &#8212; is playing with home-made nitroglycerine. Eventually it will blow up. Eventually, someone will do something with global consequences. Maybe they&#8217;ll make off with billions; maybe they&#8217;ll crash the economy of an entire country, or the world.</p>
<p>This will start a really big fight. And the lesson I&#8217;ve learned is that the code, while powerful, never has the last word. Eventually, there will have to be a legal and political settlement about what code the global financial markets should run on.  Ultimately, the code runs on people, not the other way around.</p>
<p>Yet code still has enormous influence. Financial technologists are now engaged in writing the code that will determine the future shape of the economy. Code is like architecture: it&#8217;s a built environment that determines where you can and cannot go. The code that the markets run on implicitly determines our economic policy. It sets the shape of financial hacking. It very literally decides who gets what.</p>
<p>So what economic policy do we want our code to embody? And given the complexity of computation, how can we be sure that this is what our code actually does? The answer is that we probably can&#8217;t, and the only solution is to get clear about our goals, and the legal and political mechanisms for resolving our arguments, before we inevitably discover that our software allows something we never intended.</p>
<p>I can do no better than to end with a <a href="https://twitter.com/Dymaxion/status/464645883100139521">quote</a> from security researcher Eleanor Saitta:</p>
<blockquote><p>Repeat after me: all technical problems of sufficient scope or impact are actually political problems first.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/the-dark-clouds-of-financial-cryptograpy/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>The Origin of Banking</title>
		<link>http://jonathanstray.com/the-origin-of-banking</link>
					<comments>http://jonathanstray.com/the-origin-of-banking#comments</comments>
		
		<dc:creator><![CDATA[Jonathan Stray]]></dc:creator>
		<pubDate>Tue, 27 Sep 2016 18:43:05 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">http://jonathanstray.com/?p=4198</guid>

					<description><![CDATA[There is a just-so story that explains the existence of money. Before money, the story goes, we all had to barter for the goods we wanted. If I wanted wheat and had chickens, I needed to find someone who wanted chickens and had extra wheat. Money solves this “double coincidence” problem by letting me sell &#8230; <a href="http://jonathanstray.com/the-origin-of-banking" class="more-link">Continue reading <span class="screen-reader-text">The Origin of Banking</span></a>]]></description>
										<content:encoded><![CDATA[<p>There is a just-so story that explains the existence of money. Before money, the story goes, we all had to barter for the goods we wanted. If I wanted wheat and had chickens, I needed to find someone who wanted chickens and had extra wheat. Money solves this “double coincidence” problem by letting me sell my chickens to buy your wheat. If we didn’t have money we’d invent it immediately.</p>
<p>The problem with this simple story is that it may not match history. There has never been a pure barter economy, <a href="http://www.theatlantic.com/business/archive/2016/02/barter-society-myth/471051/">according to anthropologists</a>. Pre-money economies were organized in a variety of other ways, including central planning, informal gift economies, and IOUs denominated in cows.</p>
<p>Sir Jon Hicks’ classic <em><a href="https://books.google.com/books?id=UuLnCwAAQBAJ&amp;pg=PA41&amp;lpg=PA41&amp;ots=TzGrYAmhjb&amp;sig=oBcyIIfypGuvUvDpn-rqiROsYuU&amp;hl=en&amp;sa=X&amp;ved=0ahUKEwif5svS66_PAhUGNz4KHbUFAfgQ6AEIHjAA#v=onepage&amp;q&amp;f=false">A Market Theory of Money</a> </em>fills this gap.  <a href="https://en.wikipedia.org/wiki/John_Hicks#Career.2C_influences.2C_and_honours">Hicks</a> was a major figure in 20th Century economics who eventually won a Nobel, and here at last is a straightforward story that explains why we have banks at all. It&#8217;s still not clear to me that this account is historically grounded – or that we can understand what a modern bank does, or should do, on the basis of historical parable &#8212; but at least this account provides a better history than barter.</p>
<p>With that cautionary note, here’s Hicks’ story of banking. He begins in a world where money is already the usual form of payment, and breaks down a transaction into three pieces:<span id="more-4198"></span></p>
<ol>
<li>Buyer and seller reach an agreement on what is to be sold at what price</li>
<li>Buyer delivers the goods</li>
<li>Payer delivers the cash</li>
</ol>
<p>Step 1 has to come first, but payment and delivery may come in any order at any time after that, depending on the agreement that the parties made. The gap between contracting and payment is <em>credit</em>. Credit is a very old idea, and central to modern economies. Hicks argues that “payment on the spot” is actually the uncommon case, at least for orders over a certain size:</p>
<blockquote><p>I may pay spot for a newspaper as I walk along the street, but I may also give an order to a newsagent to deliver a copy to my house each morning. I should not then pay for each issue as I received it; I should wait until the end of the month when he sent in his bill. … It is probably true that only for small transactions – small that is, from the point of view of one or other of the parties concerned – that the spot method of payment is ordinarily preferred. People are not, and never have been, in the habit of carrying about them a sufficient quantity of coin or notes to pay for a house or pay for furnishing it.</p></blockquote>
<p>The key observation is that credit is typical, not extraordinary. Any time we pay a bill – whether a at restaurant or for a credit card &#8212; we have been extended credit.</p>
<p>In the gap between contracting and payment there is <em>debt</em>, and debt is measured in money (at least on the buyer’s side; for the seller, debt is measured in goods or services owed.) There has long been argument over what exactly money <em>is</em>, or more usefully what it <em>does</em>, but in a credit-based theory of the economy it has two clear roles:</p>
<blockquote><p>We seem thus to be left with two distinguishing functions of money: standard of value and medium of payment. Are they independent, or does one imply the other? It is not easy to see that there can be payment, of a debt expressed in money, unless money as a standard has already been implied in the debt that is to be paid. So money as a means of payment implies money as a standard. But could a debt expressed in money be discharged other than in money? Surely it could.</p>
<p>It could for instance be set off against another debt, the debt from A to B being cancelled against a debt from B to A.</p></blockquote>
<p>This is Hicks’ entry into the concept of an IOU, which seems to be fundamental to modern finance – perhaps <em>the</em> fundamental idea, the notion underlying every financial instrument of every kind. Yes, you can pay money to settle a debt, but you can also cancel one debt against another, <em>netting</em> the debts. This means that a debt owed to you has monetary value! From there, it’s a small step to the idea that a third party debt can be used as a form of payment. Suppose B owes A a debt, and C owes B a debt of a different amount.</p>
<blockquote><p>A is then asked to accept part payment in the form of a debt from C to B, which is to offset the balance of debt between A and B, a balance we take to be in favour of A. But A can hardly be expected to consent to such an arrangement unless he considers that C is to be trusted. So there is a question of trust, or confidence, as soon as a third party is brought in.</p></blockquote>
<p>This short paragraph states a pattern that has been at the core of trade for centuries, and is at the core of finance today: the transferability of debts made possible by the assurance of good credit. This was a common pattern in the <a href="https://cpb-us-e1.wpmucdn.com/sites.dartmouth.edu/dist/6/1163/files/2017/03/99-03.pdf">trade fairs of Renaissance Italy</a>, where merchants would meet to settle tangled webs of IOUs with each other and with the banks. It happens today when a bank B lends money to A to buy a house, creating a mortgage debt from A to the bank, then sells the right to collect that debt to another bank C. For this to happen, B has to guarantee to C that A is creditworthy enough to repay.  It&#8217;s less obvious, but equally applicable, when A pays B by check. B doesn&#8217;t have &#8220;money&#8221; when they have the check, but a promise from A&#8217;s bank to pay. But we’re not there yet. Here’s how Hicks builds up to tradable debt:</p>
<blockquote><p>The quality of debt from a particular trader depends on his reputation: it will regularly be assessed more highly by those who are in the habit of dealing with him, and know that his a accustomed to keeping is promises, than by those who do not have the advantage of this information.</p></blockquote>
<p>Thus the value of a debt is sensitive to <em>information</em>. It’s not clear to me whether anyone would have used this language in, say, Renaissance Italy. Hicks, writing in 1989, would have been influenced by recent, eventually Nobel-wining work on <a href="https://en.wikipedia.org/wiki/Information_asymmetry">information in economics</a>. The information view of value explains how formerly solid debt-based assets – for example, mortgage-backed securities – can evaporate almost instantly if there is a credible threat of non-payment. Although debt is tradable like money in the good times, in bad times everyone wants hard currency, not promises to pay currency.</p>
<p>Hicks says that this information problem – really a reputation problem – leads to the creation of a market for guarantees that a bill will be paid.</p>
<blockquote><p>Thus we may think of each trader as having a circle of traders around him, who have a high degree of confidence in him, so that they are ready to accept his promises at full face value or near it; there is no obstacle to offsetting of debts within that circle from lack of confidence in promises being performed. If he wants to make purchases outside his circles he will not be so well placed. Circles however may overlaps: though C is outside A’s circle, he may be within the circle of D, who himself is inside the circle of A. Then though A would not accept a debt from C if offered directly, he may be brought to accept it if it is guaranteed by D, whom he knows D is then performing a service to A, for which he may be expected to charge.</p></blockquote>
<p>This is a market for <em>acceptances of bills of exchange, </em>a financial instrument that seems to be uncommon today, but was quite common in 19<sup>th</sup> century merchant banking, as described by <a href="https://papers.ssrn.com/sol3/papers.cfm?abstract_id=2232016">Bagehot</a>. From the merchant’s point of view, the objective of all of this is to get paid sooner. Suppose you sell goods to B in exchange for a bill with a specified due date, say 60 days from now. That’s a debt, and one way to use it is just to wait 60 days until B pays cash. Or you could trade that debt immediately with any person C who thinks B trustworthy – perhaps for cash, perhaps to settle a debt with C, perhaps to make a purchase. If you wanted to trade with someone who didn’t know B, you could first buy an acceptance and then trade the bill together with the acceptance – the debt together with its guarantee.</p>
<p>An acceptance is basically insurance: a guarantee that a bill will be paid, in fact the promise to pay the bill if the debtor defaults. The guarantor is willing to do this because they know, or have some way to evaluate, the reputation of the debtor, and because they charge a fee for the service. The equivalent modern instrument would be something like a “credit default swap.”</p>
<p>Notice that we don’t have banks yet. Instead, this story tells of the creation of the first markets for debt, facilitated by intermediaries who guarantee repayment. And here’s where I start to hesitate. It’s a nice story, certainly an account of how this <em>could</em> have happened. But I’m not enough a historian to know if this is how it <em>did</em> happen. Like barter, this could be an attractive myth. Still, it’s a useful account of a problem to be solved – how do I trade my debt assets outside the small circle of people who know the debtor personally? For if debt is tradable, then I suddenly have a lot more capital at my disposal: not just the cash I’m currently holding, but all of the cash that is owed me.</p>
<p>According to Hicks, the next step in the story of banking is the creation of two special kinds of intermediaries. The first sells guarantees (acceptances) on debt. They either know many debtors well, like a credit rating agency, or they know where to buy acceptances from someone who does know. The other kind of intermediary pays cash for debts along with their acceptances, at a <em>discount </em>from the face value of the debt<em>, </em>that is, a fee.</p>
<blockquote><p>Until that point, the principal reason why the market value of one bill should differ from another is the difference in reliability; but bills, between which no difference in reliability is perceived, may still differ in maturity. A trader who is in need of cash needs it now, not (say) six months hence. So there is a discount on a prime bill which is a pure matter of time preference – a pure rate of interest.</p></blockquote>
<p>Here Hicks is distinguishing between what would today be called <em>credit risk</em>, the risk of non-repayment which is solved by acceptances, and “time preference,” that is, the advantage of having cash now instead of later, which costs interest. These two components of price (and more besides such as <em>liquidity risk</em>) are implicit any time debt is sold. Hicks believes that separating these out is a necessary step to explaining how banking arose:</p>
<blockquote><p>The trouble is that the establishment of a competitive market for simple lending is not at all a simple matter. The lender is paying <em>spot</em>, for a promise the execution of which is, by definition, in the future. Some degree of confidence in the borrower’s creditworthiness – not just his intention to pay but his ability to pay, as it will be in the future – is thus essential to it. There cannot be a competitive market for loans without some of this assurance.</p></blockquote>
<p>It’s a fine argument, and indeed there is always both credit risk and time preference in lending (or buying debt for cash, which is nearly the same thing.) But I’m not convinced this is a historical account. Did the biblical money lenders really distinguish between credit risk and time preference when they set their interest rates? I suspect the answer is no. Yet surely there were reasons that the first money lenders came into existence – that is, motivating problems that offer hints as to <em>what banks do</em>. It may be possible to offer an account of the creation of banking which is both simpler, more motivating, and more historical than Hicks’ story of acceptances and discounts.</p>
<p>From a network of discounters for bills – intermediaries who are willing to lend cash against a guaranteed debt – we finally come to banks proper. Hicks explains the origin of banking by asking how trade volume could ever increase when there’s a fixed supply of cash among merchants:</p>
<blockquote><p>What then is to happen if trade expands, so that more bills are drawn, and more come in to be discounted? Where is the extra cash that is needed to come from? Any one of the dealers could get more cash by getting other dealers to discount bills that he holds. But the whole body of dealers could not get more that way. They must get cash from outside the market. They themselves must become borrowers.</p>
<p>The solution was to combine this business with another sort of business, which in the days of metallic money we know to have already made its appearance.</p></blockquote>
<p>This other business is goldsmiths, or perhaps moneychangers, both of which would store a customer’s coins in their vault. There has long been a need for secure money storage, something better than cash under the mattress. The innovation of modern banking is to recognize that not every customer will withdraw all their coins all at once.</p>
<blockquote><p>Then, once that happens, there will be a clear incentive to bring together the two activities – lending to the market, and ‘borrowing’ as a custodian from the general public – for the second provides the funds which in the first are needed. At that point the combined concern will indeed have been becoming a bank.</p></blockquote>
<p class="graf graf--p">This, then, is the essence of banking: take deposits, make loans. Crucially, a loan is in fact <em class="markup--em markup--p-em">borrowing</em> from the depositors and lending at different time scale (<a class="markup--anchor markup--p-anchor" href="https://en.wikipedia.org/wiki/Maturity_transformation" target="_blank" rel="noopener noreferrer" data-href="https://en.wikipedia.org/wiki/Maturity_transformation">maturity transformation</a>). The debtor pays back the loan at a later date, or perhaps little by little as with a mortgage, but the depositors can demand the whole of their account as cash at any moment. It is only by hoping that not everyone wants their cash back all at the same time that a bank can exist. A bank which did not borrow from its depositors would be incapable of extending credit, at least beyond the capital that its owners are putting in.</p>
<p>This is the “fractional reserve” system which has existed for centuries. Banks are by law allowed to lend at most some large fraction of their deposits, hedging against many depositors asking for their money back all at once (though note, today banks can always borrow more reserves from the central bank, so capital reserve requirements <a href="http://papers.ssrn.com/sol3/papers.cfm?abstract_id=2416234">don&#8217;t really constrain lending</a>.)</p>
<p>On this account, the central features of a bank are:</p>
<ul>
<li>Taking deposits, which can be withdrawn at any time</li>
<li>Making loans, which are repaid slowly</li>
</ul>
<p>In other words: short-term borrowing to finance long term lending. There&#8217;s nothing surprising in this description, and it captures the inherent risk-taking in banking, since it may happen that everyone wants their deposits back as cash all at once. Today, US banks are insured up to $250,000 per account by the FDIC, which simultaneously pays out if needed and makes payout less necessary since the guarantee makes bank runs less likely.</p>
<p>But something key is missing: the banks&#8217; central role in the payment system allows them to create high quality tradeable debt &#8212; that is, bank deposits. For most people, bank balances <em>are</em> money, therefore a bank can <em>create</em> money. To explain how, Hicks examines the evolution of a bank&#8217;s debt to its depositors.</p>
<blockquote><p>It would however always have happened that when cash was deposited in the bank, some form of receipt would be given by the bank. If the receipt were made transferrable, it could itself be used in payment of debt, and that should be safer [than moving cash around physically.]</p></blockquote>
<p>Hicks uses this idea of a “receipt” to trace the development of the bank check, and from there the modern reality that bank deposits <em>are</em> money as far as you and I are concerned. Consider how one person pays another through the banking system:</p>
<blockquote><p>It would at first be necessary for the payer to give an order to his bank, then to notify the payee that he had done so, then for the payee to collect form the bank. Later it was discovered that so much correspondence was not needed. A single document, sent by debtor to creditor, instructing the creditor to collect from the bank, would suffice. It would be the bank’s business to inform the creditor whether or not the instruction was accepted, whether (that is) the debtor had enough in his account in the bank to be able to pay.</p></blockquote>
<p>The key point is that with a check – or with any of our modern means of electronic payment – no cash is ever withdrawn from the bank! We have simply rewritten the amounts owed by the banks to each customer. That is, if I pay you, my bank owes me less cash and your bank owes you more. It would be no problem if in fact my cash had been loaned out to someone else during this whole time.</p>
<p>In fact, banks don’t really loan cash either.</p>
<blockquote><p>When the bank makes a loan it hands over money, getting a statement of debt (bill, bond, or other security) in return. The money might be taken from cash which the bank had been holding, and in the early days of banking that may have often happened. But it could be all the same to the borrower if what he received was a withdrawable deposit in the bank itself. The bank deposit is money from his point of view, so from his point of view there is nothing special about this transaction. But from the bank’s point of view, it has acquired the security without giving up any cash; the counterpart, in its balance-sheet, is an increase in its liabilities. &#8230; But from the point of view of the rest of the economy, the bank has ‘created’ money. This is not to be denied.</p></blockquote>
<p>Bank deposits are not cash. They are debt to customers.  But we are happy to have bank deposits because banks have become the way in which we pay each other. When someone owes us money, we are satisfied with &#8220;money in the bank&#8221; rather than cash in hand. This all goes back the the tradability of debt that Hicks started with: Banks create debt of high quality, that is, debt which can be traded from hand to hand nearly as well as cash, or perhaps better. In that very real sense, banks create money.</p>
<p>Hicks has tried to explain how this combination of features we call banking arose. The story he gives is a progression from debt trading, to acceptances, to loaning cash against bills, to merging with the money storage industry, to a central role in the payment system, to creating money by lending some large fraction of customer deposits. I am not convinced that banks actually arose in this sequence. However, it does highlight some of the needs and problems that led to the creation of banking. Namely: consumers need a place to store money, businesses need credit, and everyone needs a payment system.</p>
<p>But the advantage of Hicks&#8217; telling is that it highlights the central role of credit/debt. As soon as debt can be freely traded to a third party, it is a kind of money. It is this trust that allows a bank to create money. How much money a bank <em>should</em> create is a different question, which Hicks&#8217; parable cannot tell.  Rather, I find this pattern of tradable debt useful for thinking about all the different forms that banking takes, including by the many financial institutions that don&#8217;t call themselves banks.</p>
]]></content:encoded>
					
					<wfw:commentRss>http://jonathanstray.com/the-origin-of-banking/feed</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
			</item>
	</channel>
</rss>
