The Virtue of Constancy


Quantity over Quality)

You can find a live version of To Pray Without Ceasing here and its code here.

Once a day it will fetch new expressions of need from Twitter and generate prayers for them. It only does so for those Twitter users with very few followers, for the unpopular shall inherit the web. Even if nobody visits To Pray Without Ceasing’s site during a given day, its ministrations will continue, if only on a rented server in the cloud.

To Pray Without Ceasing relies on techniques of natural language processing to try to make sure that its prayers “make sense.” For instance, it uses vector-based information retrieval to find, for each statement of need, the most apt prayer. Sometimes it also finds a relevant Proverb. Not infrequently it will seem “wrong.” Even relatively clever machine learning models make all sorts of silly and embarrassing mistakes.

No matter! Quality is less important than quantity. The chief advantage of using a computer to automatically pray is that computers are relentless factories of language. A human, unaided by algorithm, would no doubt be able to offer better prayers—more sensitive or more thoughtful ones (not to mention more coherent and grammatical). But only the computer can pray without ceasing, can pay equal attention to an infinite procession of needful strangers, can operate at scale.

Prayer is a “real absolute waste of time” (Herbert McCabe OP). It is “not merely non-productive, non-money-making, but is even non-creative.” In the context of the contemporary information economy, constancy itself is not a virtue but an excessive consumption, a waste; why do the same thing again and again? No, better to re-skill, re-optimize, re-invent oneself every year, quarter, or hour. What have you done today to pursue your own excellence, to keep yourself from being outmoded and economically worthless, despised and forgotten? Likewise our social media feeds demand that we flit from stimulus to stimulus, another sort of restless optimization.

I say “we,” but I’m talking about myself. So I’ll conclude with an autobiographical rationale for this project: with To Pray Without Ceasing, I have tried to make a computational system that—whatever its faults and limitations—is in some limited but objective sense a better person than I am. And one that invites me into its way of paying attention to the world, with constancy.

Cloud Plumbing

When I titled this project To Pray Without Ceasing, I was serious. I want the system to be able to try to pray indefinitely for the needs expressed by Twitter users. Today I’ll share some of the challenges of making its unceasing prayer possible.

  1. TPWOC’s prayer-generation code outputs prayers in response to input texts gathered from Twitter, tweets that express needs (e.g. “I really need a friend”). Gathering these is easy enough. On a server, a program downloads recent examples of such tweets once a day via Twitter’s API. This is done automatically via a cron job.
  2. However, because it uses some large statistical models that must be loaded into memory, TPWOC’s prayer-generation code is too resource-hungry to run on this same server, and renting the requisite cloud-computing resources would likewise be prohibitively expensive. I want to make TPWOC sustainable (for Nokturno and for myself), so my current imperfect solution is simply to download the need-expressing tweets from my server and generate prayers for them using the resources of my local machine. Again using cron, I have set up my computer to try to do this automatically. It actually attempts to do so several times throughout the day in case I happen to have my computer turned off for some part of it. (Why not simply have Step 1 accomplished on my own computer rather than on my server? Because, due to limitations that Twitter places on its API, collecting tweets takes a rather long time. The more time-intensive processes that can be offloaded from my own computer, the better.)
  3. To make TPWOC’s prayer interface available on the web, I deploy it as a web-app via one of the major “cloud platform as a service” providers. But this web-app is simply a way of presenting the prayers, which it does not generate and which it does not at first possesses. I have set up my computer to periodically upload ready-to-pray prayers to an Amazon S3 “bucket,” a vessel from which my web-app can conveniently fetch them at regular intervals and display them to visitors.

The entire sequence of events looks like this:

I hardly expect these details to be particularly fascinating on their own. For my part, I do not relish setting up all this finicky pipework. However, I share these details in order to demonstrate that, if TPWOC is able to pray pseudo-infinitely, this effect is achieved not at the level of code per se but at the level of infrastructure—itself a medium that, like paint, film, or print, brings its particular affordances and limitations.

Private Chapel

During the first week (or so) of my residency, I have taken on the task of figuring out how exactly I will present the output of To Pray Without Ceasing’s text-generation system—how to create the experience of a virtual monastery, chapel, or sanctified grotto that befits its prayers.

For a couple of years I have been interested in building web-applications that, if they are not quite “user-unfriendly,” do place demands on the user that could be considered impolite or severe. For instance, in an earlier project, I experimented with displaying text only when the user/reader was almost perfectly still and silent (according to data from the computer’s webcam and microphone). Likewise, in a preliminary attempt at a web-interface for TPWOC that I hastily coded up some weekend a while back, I considered taking a similar route but making the requirements even more stringent. For instance, perhaps TPWOC should not reveal its prayers until it confirms that the user/reader has assumed a somber religious posture by holding a(n actual, physical) candle in stillness and in silence. I set up a rudimentary demo, a Flask app that piped webcam data to Rekognition (Amazon’s computer vision service), in order to detectUserCandle().

This approach, I decided, had too many problems. Due to the use of Rekognition, it would be too expensive to host on the web for long periods. Using computer vision at all—especially a proprietary service run by Amazon—raises privacy issues, and these would distract from the spirit of the project. And anyway, after sitting in front of my computer while holding a candle in order to test the demo, I determined that I could not expect users/readers to do the same for longer than a few minutes.

I want to strike a balance between, on the one hand, making TPWOC so exacting that nobody would want to spend much time with it and, on the other, making it so easily-consumable that it provides no resistance. So these past several days I have been working on a different solution, one that that still demands that the user/reader piously tend to glowing candles, albeit virtual ones.

My current notion is that TPWOC will generate and display prayers only so long as the user/reader keeps at least one of these candles lit. Like real candles, they slowly exhaust themselves. Instead of using the webcam to track the user’s physical movements and enforce their stillness, I’m now merely tracking their cursor to make sure it doesn’t move too fast. (One would not expect to be able to sprint in a non-virtual monastery or sacred grotto without being gently chided.) Debugging this part of the code has given me the opportunity to see just how quickly and blithely my cursor usually jitters and sprints around the screen.

Way back when I proposed this project, I had imagined an interface that would be—if not collaborative—congregative. I thought people should be able to gather in real-time to witness and participate in TPWOC’s prayerful routine. While I am still planning a performance that would make this sort of experience temporarily possible (more on that later), I no longer think that this should be the default mode of engaging with TPWOC. COVID-19 has something to do with it. My inbox deluged with Zoom invitations, I have become less desirous of software that tries to fabricate an ersatz conviviality.

To Pray Without Ceasing

This is my first journal entry as Nokturno’s Fall 2020 poet-in-residence. Today I’ll briefly explain the project and what I hope to accomplish during my time as a resident.

To Pray Without Ceasing is a poetic text-generation system that, given a statement of need (or “special intention“) such as “I really need somebody to talk to” or “I really need to stop eating late at night,” will output a series of prayers that are specific to this need.

Why program a text-generation system to pray? All day and night, people post expressions of their own desires and needs on social networks. But there is not enough attention or solicitude to go around. People are left lonely, ignored, abandoned. To Pray Without Ceasing is designed to incessantly think about others, to pray for strangers whose statements of need it discovers online. In his first letter to the Thessalonians, St. Paul enjoins them to “pray without ceasing.” If I cannot do this—if I am bound to become distracted by my own problems, bound to forget to remember others—perhaps I can design a system that will do so on my behalf.

I began preliminary work working on To Pray Without Ceasing in early in 2020, pre-pandemic. Entering the residence period, I have completed what I would consider rough drafts of six different prayer-generation techniques, each one corresponding to one of the canonical hours (Matins, Lauds, Prime, Terce, Sext, Nones, and Vespers). My primary goals for the residence are:

  • to refine these text-generation methods, and add one for the final canonical hour (Compline);
  • to develop an interface that does not merely present the prayers but in some way recruits the reader in the act of praying;
  • and to automate the generation of prayers based on statements of need expressed on Twitter so that the machine may indeed “pray without ceasing.” (For technical reasons I will explain in a later post, this is non-trivial.)

I’ll end here by thanking Virpi Vairinen, Teemu Tuovinen, and everyone at Nokturno for this this time, space, and support. Thanks also to Mirva Liimatta for designing the residence’s logo, the coil of smoke atop this page.