If there's anyone out there with solid knowledge of economics who can make corrections to the following post, I'd appreciate it. That said, here is my current understanding of why deficit spending isn't prima facie bad, long or short term. I'll use two examples, the country and a single hypothetical household, and I'll probably move freely between the two.
There are two important numbers to know. The first is the rate that revenue is increasing year over year. This should be pretty easy to calculate without much controversy. For the household the primary source of increased income will probably be a pay raise from work (whether you work for yourself or someone else). For a country, we're concerned with the rate at which revenue grows, which may not may not be the same as the rate of growth in the GDP (depending on how increased income is distributed across tax brackets, and so forth).
The second important number is the size of the annual deficit as a percentage of existing debt. If a household owes $1000 and incurs an additional $100 debt in a given year, the deficit rate is 10% (assuming that interest payments on the outstanding debt have been included in this bottom line already, as an expenditure). Often you'll see a deficit given as a percentage of GDP, but I think it makes more sense to think of it as the rate of growth of outstanding debt.
Why? Because the most common complaint about deficits is that by spending money we don't have we're just deferring payments to the future and compounding interest, thereby ensuring we'll have to pay more later than we would now. Some opponents of deficit spending call deficits a "hidden tax" on future earnings. But this is only true if the deficit rate is higher than the growth rate.
If the growth rate is higher than the deficit rate, the money we pay back later has less value than the money we spent initially. For a household, consider student loans. If a student borrows $1000 to pay for college and then finds a job paying twice as much as he would have earned without a college education, the money he'll pay back ($1000 plus interest) is worth almost half as much to him as the money he borrowed. The decicion to deficit spend to pay for college is almost always the right choice. Similarly, a business owner who borrows money to buy new equipment can end up considerably better-off than he would have if he had waited to save up the money and pay in cash.
If the revenue growth rate is higher than the deficit rate (the debt growth rate) then the relative size of the deficit can be shrinking even while the absolute sizes of the deficit and debt are growing.
This doesn't mean it's always a good idea to borrow money for things, but it can be. It's not necessary for a family or a country to run a balanced budget, as long as their income growth rate exceeds their debt growth rate. In fact, it is easy to see that if a family or country doesn't deficit spend they may be missing profitable opportunities and even hurting themselves economically.
How does this tie into artificial intelligence?, you ask. Not the way you might think.